Search completed in 1.00 seconds.
544 results for "library":
Your results are loading. Please wait...
Porting the Library Detector - Archive of obsolete content
this example walks through the process of porting a xul-based add-on to the sdk. it's a very simple add-on and a good candidate for porting because there are suitable sdk apis for all its features. the add-on is paul bakaus's library detector. the library detector tells you which javascript frameworks the current web page is using. it does this by checking whether particular objects that those libraries add to the global window object are defined. for example, if window.jquery is defined, then the page has loaded jquery. for each library that it finds, the library detector adds an icon representing that library to the status bar. it adds a tooltip to each icon, which contains the library name and version. you can browse and run the ported version in the sdk's examples directory. how the l...
...window.jquery is defined, then the page has loaded jquery. for each library that it finds, the library detector adds an icon representing that library to the status bar. it adds a tooltip to each icon, which contains the library name and version. you can browse and run the ported version in the sdk's examples directory. how the library detector works all the work is done inside a single file, librarydetector.xul this contains: a xul overlay a script the xul overlay adds a box element to the browser's status bar: the script does everything else. the bulk of the script is an array of test objects, one for each library. ...
... the script listens to gbrowser's domcontentloaded event. ...
...And 20 more matches
Dynamic Library Linking
this section describes nspr's programming interface to load, unload and resolve symbols in dynamic libraries. it also provides a method by which to condition symbols of statically linked code so that to other clients it appears as though they are dynamically loaded. library linking types these data types are defined for dynamic library linking: prlibrary prstaticlinktable library linking functions the library linking functions are: pr_setlibrarypath pr_getlibrarypath pr_getlibraryname pr_freelibraryname pr_loadlibrary pr_unloadlibrary pr_findsymbol pr_findsymbolandlibrary finding symbols defined in the main executable program pr_loadlibrary cannot open a handle that references the main executable program. (this is admittedly an omission that should be fixed.) however, it is...
...getlibraryname pr_freelibraryname pr_loadlibrary pr_unloadlibrary pr_findsymbol pr_findsymbolandlibrary finding symbols defined in the main executable program pr_loadlibrary cannot open a handle that references the main executable program. (this is admittedly an omission that should be fixed.) however, it is possible to look up symbols defined in the main executable program as follows. prlibrary *lib; void *funcptr; funcptr = pr_findsymbolandlibrary("functionname", &lib); when pr_findsymbolandlibrary returns, funcptr is the value of the function pointer you want to look up, and the variable lib references the main executable program. you can then call pr_findsymbol on lib to look up other symbols defined in the main program. ...
... this section summarizes these platform idiosyncrasies. ...
...And 5 more matches
Library
the library object represents a native library loaded by the ctypes open() method. its methods let you declare symbols exported by the library, and to manage the library. method overview close(); cdata declare(name, [abi, ], returntype[, argtype1, ...]); methods close() closes the library. you need to call this once you're done using the library. close(); parameters none. declare() declares an api from the native library, allowing it to be used from javascript. this can be used both for exported data symbols and for functions. ...
...see abi constants. you don't need to provide this for exported data; it's only needed for function declarations. ...
...turn 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 the symbol which holds the address to an external block. this would be d...
... 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. ...
PR_FindSymbolAndLibrary
finds a symbol in one of the currently loaded libraries, and returns both the symbol and the library in which it was found. syntax #include <prlink.h> void* pr_findsymbolandlibrary ( const char *name, prlibrary **lib); parameters the function has these parameters: name the textual representation of the symbol to locate. lib a reference to a location at which the runtime will store the library in which the symbol was discovered. this location must be pre-allocated by the caller. returns if successful, returns a non-null pointer to the found symbol, and stores a pointer to the library in which it was found at the location pointed to by lib. if the symbol could not be found, returns null. description this function finds the specified symbol in one of the currently loaded lib...
... non-null pointer to the found symbol, and stores a pointer to the library in which it was found at the location pointed to by lib. if the symbol could not be found, returns null. description this function finds the specified symbol in one of the currently loaded libraries. it returns the address of the symbol. upon return, the location pointed to by the parameter lib contains a pointer to the library that contains that symbol. the location must be pre-allocated by the caller. the function returns null if no such function can be found. the order in which the known libraries are searched in not specified. this function is equivalent to calling first pr_loadlibrary, then pr_findsymbol. ...
...b contains a pointer to the library that contains that symbol. the location must be pre-allocated by the caller. the function returns null if no such function can be found. the order in which the known libraries are searched in not specified. this function is equivalent to calling first pr_loadlibrary, then pr_findsymbol. the identity returned from this function must be the target of a pr_unloadlibrary in order to return the runtime to its original state. ...
BundleLibrary - Archive of obsolete content
note: these bundles have not be tested with the latest version of prism and probably won't run. we are working on a new bundle library compatible with the current prism version and welcome any contributions from the developer community. ...
...aol email : aolemail.webapp bbc radio player bbcradioplayer.webapp bloglines : bloglines.webapp bloglines beta: beta.bloglines.webapp chandler: chandler.webapp flash earth (integrates all major mapping sites) flashearth.webapp flickr: flickr.webapp gollum wikipedia browser in english:gollum_en.webapp google notebook: gnote...
PR_FreeLibraryName
returns nothing. description this function deletes the storage allocated by the runtime in the functions described previously. ...
... returns nothing. description this function deletes the storage allocated by the runtime in the functions described previously. ...
PR_GetLibraryName
constructs a full library path name. syntax #include <prlink.h> char* pr_getlibraryname ( const char *dir, const char *lib); parameters the function has these parameters: dir a null-terminated string representing the path name of the library, as returned by pr_getlibrarypath. lib the leaf name of the library of interest. returns if successful, returns a new character string containing a constructed path name. in case of error, returns null. description this function constructs a full path name from the specified directory name and library name. the constructed path name refers to the actual dynamically loaded library. it is suitable for use in the pr_loadlibrary call. this function does not test for existence of the specified file, it just constructs the full filename. th...
... ...
PR_LoadLibrary
loads a referenced library. syntax #include <prlink.h> prlibrary* pr_loadlibrary(const char *name); parameters the function has this parameter: name a platform-dependent character array that names the library to be loaded, as returned by pr_getlibraryname. returns if successful, returns a reference to an opaque prlibrary object. if the operation fails, returns null. use pr_geterror to find the reason for the failure. description this function loads and returns a reference to the specified library. the returned reference becomes the library's identity. the function suppresses duplicate loading if the library is already known by the runtime. ...
...essful, returns a reference to an opaque prlibrary object. if the operation fails, returns null. use pr_geterror to find the reason for the failure. description this function loads and returns a reference to the specified library. the returned reference becomes the library's identity. the function suppresses duplicate loading if the library is already known by the runtime. each call to pr_loadlibrary must be paired with a corresponding call to pr_unloadlibrary in order to return the runtime to its original state. ...
PRLibrary
an opaque structure identifying a library. syntax #include <prlink.h> typedef struct prlibrary prlibrary; description a prlibrary is an opaque structure. a reference to such a structure can be returned by some of the functions in the runtime and serve to identify a particular instance of a library. ...
PR_GetLibraryPath
retrieves the current default library path. syntax #include <prlink.h> char* pr_getlibrarypath(void); parameters the function has no parameters. returns a copy of the default library pathname string. in case of error, returns null. description this function retrieves the current default library pathname, copies it, and returns the copy. if sufficient storage cannot be allocated to contain the copy, the function returns null. storage for the result is allocated by the runtime and becomes the responsibility of the caller. when it is no longer used, free it using pr_freelibraryname. ...
PR_SetLibraryPath
registers a default library pathname with a runtime. syntax #include <prlink.h> prstatus pr_setlibrarypath(const char *path); parameters the function has this parameter: path a pointer to a character array that contains the directory path that the application should use as a default. the syntax of the pathname is not defined, nor whether that pathname should be absolute or relative. returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. this may indicate that the function cannot allocate sufficient storage to make a copy of the path string description this function registers a default library pathname with the runtime. this allows an environment to express policy decisions globally and lazily, rather than hardcoding a...
PR_UnloadLibrary
unloads a library loaded with pr_loadlibrary. syntax #include <prlink.h> prstatus pr_unloadlibrary(prlibrary *lib); parameters the function has this parameter: lib a reference previously returned from pr_loadlibrary. returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. use pr_geterror to find the reason for the failure. description this function undoes the effect of a pr_loadlibrary. after calling this function, future references to the library using its identity as returned by pr_loadlibrary will be invalid. ...
Using Dependent Libraries In Extension Components - Archive of obsolete content
y components sometimes need to depend on other shared libraries (for example, libraries provided by a third party). the firefox extension system does not provide automatic support for loading these dependent libraries, but it is possible to load these libraries explicitly using a component stub. the basic strategy of the stub is to dynamically load the dependent libraries, then load the component library and continue registration. sample code is below, and can be built by placing the two files in extensions/stub and configuring with --enable-extensions=stub extension file structure using the stub slightly changes how components are packaged in the extension directory structure. note that the "real" component is no longer in the components/ directory, it is in the libraries/ directory. extension-d...
...directory/libraries/component.dll extension-directory/components/interface1.xpt extension-directory/components/interface2.xpt extension-directory/components/bsmedberg_stub.dll extensions/stub/makefile.in # copyright (c) 2005 benjamin smedberg <benjamin@smedbergs.us> depth = ../.. ...
...onent. we want to load the dependent libraries // of the real component, then the component itself, and call nsgetmodule on // the component. ...
...And 21 more matches
Index
an overview of nss internals api, intermediate, intro, nss, tools a high-level overview to the internals of network security services (nss) software developed by the mozilla.org projects traditionally used its own implementation of security protocols and cryptographic algorithms, originally called netscape security services, nowadays called network security services (nss). nss is a library written in the c programming language. it's free and open source software, and many other software projects have decided to use it. in order to support multiple operating systems (os), it is based on a cross platform portability layer, called the netscape portable runtime (nspr), which provides cross platform application programming interfaces (apis) for os specific apis like file system access, ...
...ws nss to work with many hardware devices (e.g., to speed up the calculations required for cryptographic operations, or to access smartcards that securely protect a secret key) and software modules (e.g., to allow to load such modules as a plugin that provides additional algorithms or stores key or trust information) that implement the pkcs#11 interface. a core element of nss is freebl, a base library providing hash functions, big number calculations, and cryptographic algorithms. softoken is an nss module that exposes most freebl functionality as a pkcs#11 module. some cryptography uses the same secret key for both encrypting and decrypting, for example password based encryption (pbe). this is often sufficient if you encrypt data for yourself, but as soon as you need to exchange signed/...
... call the appropriate dereference (destroy) functions once a handle is no longer needed. this is particularly important for applications that might need to close a database and reinitialize nss using a different one, without restarting. such an operation might fail at runtime if data elements are still being referenced. ...
...And 19 more matches
Component Internals
how components are generally implemented in xpcom, or you can skip to the next chapter, where the weblock component tutorial takes you step by step through the component creation process. xxx mediawiki...xxx sucks creating components in c++ let's start by examining how xpcom components are written in c++. the most common type of component is one that is written in c++ and compiled into a shared library (a dll on a windows system or a dso on unix). the illustration below shows the basic relationship between the shared library containing the component implementation code you write and the xpcom framework itself. in this diagram, the outer boundary is that of the module, the shared library in which a component is defined. a component in the xpcom framework when you build a component or module...
...stem or a dso on unix). the illustration below shows the basic relationship between the shared library containing the component implementation code you write and the xpcom framework itself. in this diagram, the outer boundary is that of the module, the shared library in which a component is defined. a component in the xpcom framework when you build a component or module and compile it into a library, it must export a single method named nsgetmodule. this nsgetmodule function is the entry point for accessing the library. it gets called during registration and unregistration of the component, and when xpcom wants to discover what interfaces or classes the module/library implements. in this chapter we will outline this entire process. as a component in the xpcom framework illustrates, in addit...
... discuss in some detail in the next section (see xpcom glue). these latter supply ease-of-development utilities like smart pointers, generic modules support, and simple string implementations. the largest and possibly most complex part of a component is the code specific to the component itself. but where are the components? components reside in modules, and those modules are defined in shared library files that typically sit in the components directory of an xpcom application. a set of default libraries stored in this components directory makes up a typical gecko installation, providing functionality that consists of networking, layout, composition, a cross-platform user interface, and others. another, even more basic view of this relationship of components to the files and interfaces that ...
...And 17 more matches
NSS API Guidelines
ent and usable code, but some existing code won't follow all these rules. nss api structure this section explains the structure and relationships of the nss libraries. the layering section explains how the nss code is layered, and how higher-level functions wrap low-level functions. the libraries section descibes the nss libraries, the functionality each provides, and the layer in which the library (mostly) operates. layering each separate component of the api should live in its own layer. the functions in these apis should never call api layers above them. in addition, some low-level apis may be completely opaque to higher level layers. that is, access to these functions should only be provided by the api directly above them. the nss apis are layered, as shown in this diagram: the box...
...rs. that is, access to these functions should only be provided by the api directly above them. the nss apis are layered, as shown in this diagram: the boxes in the gray section, towards the center, are exported only through pkcs #11. pkcs #11 is only exported through the wrappers. the areas which need the most work (both here and throughout the code) is: the relationship of the certificate library with just about every other component (most noticeably pkcs #12, pkcs #7, and pkcs #11) splitting low key and high key components more clearly the crypto wrappers (pkcs #11 wrappers) and high key pkcs #12 and pkcs #5 libraries nss compiles into the libraries described below. the layer indicates the main layer, seen in the previous diagram, in which the library operates. the directory is...
...y other component (most noticeably pkcs #12, pkcs #7, and pkcs #11) splitting low key and high key components more clearly the crypto wrappers (pkcs #11 wrappers) and high key pkcs #12 and pkcs #5 libraries nss compiles into the libraries described below. the layer indicates the main layer, seen in the previous diagram, in which the library operates. the directory is the location of the library code in the nss source tree. ...
...And 14 more matches
Using js-ctypes
before you can use js-ctypes, you need to import the ctypes.jsm code module. this is as simple as including the following line of code in the desired javascript scope: components.utils.import("resource://gre/modules/ctypes.jsm") loading a native library once you've imported the code module, you can call the ctypes.open() method to load each native library you wish to use. ...
...ed to import the ctypes.jsm code module. this is as simple as including the following line of code in the desired javascript scope: components.utils.import("resource://gre/modules/ctypes.jsm") loading a native library once you've imported the code module, you can call the ctypes.open() method to load each native library you wish to use. on windows, for example, you might load the system user32 library like this: var lib = ctypes.open("user32.dll"); on mac os x, you can load the core foundation library from the core foundation framework like this: var corefoundation = ctypes.open("/system/library/frameworks/corefoundation.framework/corefoundation"); the returned object is a library object that you use to declare functions and data types for use with the loaded library. note: js-ctypes only...
...brary from the core foundation framework like this: var corefoundation = ctypes.open("/system/library/frameworks/corefoundation.framework/corefoundation"); the returned object is a library object that you use to declare functions and data types for use with the loaded library. note: js-ctypes only works with c libraries; you can't use c++ methods directly. instead, you'll need to create a shim library that uses c functions that then call into the c++ library for you. examples can be found here: bugzilla :: bug 505907 - support c++ calling from jsctypes library search paths if you specify a full path, that path is used to load the library. ...
...And 14 more matches
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
you try to access its idl interfaces from your code. the files under exports are copied directly to the /mozilla/$(moz_objdir)/dist/include/ directory and are thus accessible from other modules (the value of moz_objdir is defined in /mozilla/.mozconfig). xpidlsrcs are run through the idl processor, and the generated c++ headers are copied into the same include directory. in addition, an xpt (type library) file is generated and placed in the components/ subdirectory of your extension. source files now it's time to create the makefile and source files in the src/ subdirectory. if you're implementing interfaces that you've described using idl, the easiest way to do this is to leave the src/ directory empty and run make on the public/ directory only; this will be explained shortly. ...
... paste into your implementation files. all you have to do is fill in the implementation stubs in the c++ file and you're good to go. here's an example of the makefile you need to place into your src directory: depth = ../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk is_component = 1 module = myextension library_name = myextension use_static_libs = 1 xpi_name = myextension cppsrcs = \ myfirstcomponent.cpp \ mysecondcomponent.cpp \ myextension.cpp \ $(null) include $(topsrcdir)/config/rules.mk extra_dso_ldopts += \ $(moz_component_libs) \ $(nspr_libs) \ $(null) in this example, the first two files contain the implementation of the extension's two components. the final file, mye...
...e to be safe. you can use the same module in both base/ and advanced/ so that all the generated include files go into the same directory, but make sure that you don't use the same xpidl_module in the two public/ directories or one of the component type libraries (i.e. xpt files) will overwrite the other one and all hell will break loose. each module must also have a different value for the library_name variable. this is the name of the generated dynamic library, so if we call the libraries "mybase" and "myadvanced", we'll end up with mybase.dll and myadvanced.dll (on windows, at least). and each of these modules is going to have a separate c++ file for registering components. so there will be two files that look like myextension.cpp in the original example, say base.cpp and advanced.cpp. f...
...And 10 more matches
PKCS #11 Module Specs
pkcs #11 module specs the following is a proposal to the pkcs #11 working group made in august 2001 for configuring pkcs #11 modules. nss currently implements this proposal internally. the file format consists of name/value pairs of the form name=value. each name/value pair is separated by a blank value. a single line, terminated by a '\n', '\r\n', or '\r' represents a single pkcs #11 library. names can be any alpha/numeric combination, and are parsed case-insensitive. values can contain any printable ascii value, including utf8 characters. values can contain embedded blanks either through quoting the entire value, or by escaping the embedded blanks with '\'. the value is considered quoted if the first character after the '=' is ', ", {, [, or <. if the value is quoted, then the value is ter...
...ped. embedded '\' charaters are considered escape characters for the next character in the stream. note that case must be preserved in the values. these modules specs can be passed by the application directly to nss via the secmod_loadusermodule() call. to initialize a pkcs #11 module 'on-the-fly'. recognized names all applications/libraries must be able recognize the following name values: library this specifies the path to the pkcs #11 library. name this specifies the name of the pkcs #11 library. parameter this specifies a pkcs #11 library parameter with the application must pass to the pkcs #11 library at c_initialize() time (see below). in additions applications/libraries should be able to ignore additional name value pairs which are used to specify configuration for other ap...
...parameter with the application must pass to the pkcs #11 library at c_initialize() time (see below). in additions applications/libraries should be able to ignore additional name value pairs which are used to specify configuration for other applications. of course these application/libraries should be able to parse their own name/value pairs. each of these name/value pairs are optional. if the library is not specified, the line represents some application specific meta configuration data. other applications and libraries can safely ignore this line. if the name is not specified, the application can use the library path to describe the pkcs #11 library in any ui it may have. ...
...And 10 more matches
How Mozilla's build system works
extra whitespace is compressed. the terminating $(null) is a method for consistency; it allows you to add and remove lines without worrying about whether the last line has an ending backslash or not. makefile examples standard makefile header installing headers using exports compiling interfaces using xpidlsrcs installing a javascript component building a component dll building a static library building a dynamic library makefiles - best practices and suggestions makefile - targets makefile - variables, values makefile - *.mk files & user config building libraries there are three main types of libraries that are built in mozilla: components are shared libraries (except in static builds), which are installed to dist/bin/components. components are not linked against by any othe...
...building a dynamic library makefiles - best practices and suggestions makefile - targets makefile - variables, values makefile - *.mk files & user config building libraries there are three main types of libraries that are built in mozilla: components are shared libraries (except in static builds), which are installed to dist/bin/components. components are not linked against by any other library. non-component shared libraries include libraries such as libxpcom and libmozjs. these libraries are installed to dist/bin and are linked against. you will probably not need to create a new library of this type. static libraries are often used as intermediate steps to building a shared library, if there are source files from several directories that are part of the shared library. static librar...
...as an example, below is a portion of the makefile for libmsgbaseutil, which is linked against by all of the main news components: depth = ../../.. ...
...And 9 more matches
ctypes
similar to errno in libc, available on all platforms. cannot be set. ...
...similar to errno in libc, available on all platforms. cannot be set. ...
...similar to errno in libc, available on all platforms. cannot be set. ...
...And 9 more matches
sslerr.html
or code should occur only on sockets that are acting as clients. it is a generic error, used when none of the other more specific error codes defined in this file applies. ssl_error_unsupported_certificate_type -12280 "unsupported certificate type." the operation encountered a certificate that was not one of the well known certificate types handled by the certificate library. ssl_error_unsupported_version -12279 "peer using unsupported version of security protocol." on a client socket, this means the remote server has attempted to negotiate the use of a version of ssl that is not supported by the nss library, probably an invalid version number. on a server socket, this means the remote client has requested the use of a version of ssl old...
...eded the maximum permissible length." this generally indicates that the remote peer system has a flawed implementation of ssl, and is violating the ssl specification. ssl_error_tx_record_too_long -12262 "ssl attempted to send a record that exceeded the maximum permissible length." this error should never occur. if it does, it indicates a flaw in the nss ssl library. ssl_error_close_notify_alert -12230 "ssl peer has closed this connection." the local socket received an ssl3 alert record from the remote peer, reporting that the remote peer has chosen to end the connection. the receipt of this alert is an error only if it occurs while a handshake is in progress. ssl_error_pub_key_size_limit_exceeded -12210 "ssl ...
...that the remote server has failed to perform an "ssl step down" for an export cipher. it has sent a certificate bearing a domestic-grade public key, but has not sent a serverkeyexchange message containing an export-grade public key for the key exchange algorithm. such a connection cannot be permitted without violating u.s. export policies. on a server socket, this indicates a failure of the local library. ssl_error_no_server_key_for_alg -12206 "server has no key for the attempted key exchange algorithm." an ssl client has requested an ssl cipher suite that uses a key exchange algorithm for which the local server has no appropriate public key. this indicates a configuration error on the local server. ssl_error_token_insertion_removal -12205 "pkcs #1...
...And 8 more matches
Python binding for NSS
for the setting trust attributes on a certificate, the ssl version range api, information on the ssl cipher suites and information on the ssl connection. ...
...rtificate, the ssl version range api, information on the ssl cipher suites and information on the ssl connection. ...
... ...
...And 7 more matches
Handling common JavaScript problems - Learn web development
s persisted well into the early 2000s, as old browsers were still being used and still needed supporting. this is one of the main reasons why libraries like jquery came into existence — to abstract away differences in browser implementations (e.g. see the code snippet in how to make an http request) so developers only have to write one simple bit of code (see jquery.ajax()). jquery (or whatever library you are using) will then handle the differences in the background, so you don't have to. things have improved significantly since then; modern browsers do a good job of supporting "classic javascript features", and the requirement to use such code has diminished as the requirement to support older browsers has lessened (although bear in mind that they have not gone away altogether). these days,...
...g). there are a few strategies for handling incompatibilities between browsers relating to feature support; let's explore the most common ones. note: these strategies do not exist in separate silos — you can, of course combine them as needed. for example, you could use feature detection to determine whether a feature is supported; if it isn't, you could then run code to load a polyfill or a library to handle the lack of support. feature detection the idea behind feature detection is that you can run a test to determine whether a javascript feature is supported in the current browser, and then conditionally run code to provide an acceptable experience both in browsers that do and don't support the feature. as a quick example, the geolocation api (which exposes available location data for...
...how the location on a map, perhaps using the google maps api }); } else { // give the user a choice of static maps instead perhaps } you could also write such a test for a css feature, for example by testing for the existence of element.style.property (e.g. paragraph.style.transform !== undefined). but for both css and javascript, it is probably better to use an established feature detection library rather than writing your own all the time. modernizr is the industry standard for feature detection tests. as a last point, don't confuse feature detection with browser sniffing (detecting what specific browser is accessing the site) — this is a terrible practice that should be discouraged at all costs. see using bad browser sniffing code, later on, for more details. note: some features are ...
...And 6 more matches
Standard OS Libraries
ull working example; just copy & paste it to try it out. ...
...ng to install firefox on a a non-gtk+ based linux build such as kaosx, which is qt based (details on kaosx at the time of this writing: kdelibs version 4.1.4.3, qt version 4.8.6, 64bit) would install gtk+ libraries along with it in order to enable firefox to work on the qt system. there are rumors of a firefox qt that is in the works. on linux, libraries will be typically found as .so files. one library that linux uses, and that can be used through js-ctypes, is x11. gdk as mentioned, all firefox's are a gtk+ app, which means it has to have gdk, as gdk is underlying level of gtk+. therefore all the gdk library functions are available for use. gdk has version 2 and 3, typically version 2 is referred to as just gdk and version 3 is referred to as gdk3. examples for both are found below. document...
.... documentation for gdk functions are found here: gnome developer :: gdk 2 reference manual. for gdk3 documentation is found here: gnome developer :: gdk 3 reference manual. because gnome is in the name of the websites don't get confused and think this only works on gnome. it is true though that gdk was developed by the gnome team. example: gdk_window_get_pointer this example is fot the gdk 2.0 library. in gdk 3.0 the gdk_window_get_device_position function was deprecated, see below for gdk 3.0 example. components.utils.import('resource://gre/modules/ctypes.jsm'); var gdk = ctypes.open('libgdk-x11-2.0.so.0'); // types var gint = ctypes.int; var gdkdevice = ctypes.structtype('gdkdevice'); var gdkmodifiertype = ctypes.int; var gdkwindow = ctypes.structtype('gdkwindow'); var void = ctypes.void_...
...And 6 more matches
Using LDAP XPCOM with XULRunner - Archive of obsolete content
iguring build options, just add: ac_add_options --enable-ldap to your .mozconfig file. this will create two files in the components directory of the build package: mozldap.dll (or libmozldap.so or...) mozldap.xpt and two files in the root directory of the build package: on windows: nsldap32v50.dll nsldappr32v50.dll on linux: libldap50.so libprldap50.so those are the native ldap library. ...
...re the native ldap library. if you copy as usual those files in the components directory of your xul app, this can't work. actually, the ldap interfaces are available (for exemple, components.interfaces.nsildapconnection is not null), but the components can't be loaded (for example, components.classes["@mozilla.org/network/ldap-connection;1"] is null). this is due to the fact that the native ldap library files are not found by the xulrunner process. the solution is to use the bsmedberg stub, described in using dependent libraries in extension components: the component library is just a loader of the real library and all its dependencies, so as all the needed libraries are loaded. create a subdirectory extensions/ldapstub in the mozilla source code directory, containing two files, makefile.in and ...
...dencies, so as all the needed libraries are loaded. create a subdirectory extensions/ldapstub in the mozilla source code directory, containing two files, makefile.in and ldapstubloader.cpp: makefile.in: # copyright (c) 2005 benjamin smedberg <benjamin@smedbergs.us> depth = ../.. ...
...And 5 more matches
An overview of NSS Internals
it's free and open source software, and many other software projects have decided to use it. ...
...ws nss to work with many hardware devices (e.g., to speed up the calculations required for cryptographic operations, or to access smartcards that securely protect a secret key) and software modules (e.g., to allow to load such modules as a plugin that provides additional algorithms or stores key or trust information) that implement the pkcs#11 interface. a core element of nss is freebl, a base library providing hash functions, big number calculations, and cryptographic algorithms. softoken is an nss module that exposes most freebl functionality as a pkcs#11 module. some cryptography uses the same secret key for both encrypting and decrypting, for example password based encryption (pbe). this is often sufficient if you encrypt data for yourself, but as soon as you need to exchange signed/...
... call the appropriate dereference (destroy) functions once a handle is no longer needed. this is particularly important for applications that might need to close a database and reinitialize nss using a different one, without restarting. such an operation might fail at runtime if data elements are still being referenced. ...
...And 5 more matches
Using JSS
Mozilla › Projects › NSS › JSS › Using JSS
tialize jss in your application gather components you need the jss classes and the nspr, nss, and jss shared libraries. nspr and nss shared libraries jss uses the nspr and nss libraries for i/o and crypto. jss version 3.0 linked statically with nss, so it only required nspr. jss versions 3.1 and later link dynamically with nss, so they also require the nss shared libraries. ...
...spr, nss, and jss shared libraries. nspr and nss shared libraries jss uses the nspr and nss libraries for i/o and crypto. jss version 3.0 linked statically with nss, so it only required nspr. jss versions 3.1 and later link dynamically with nss, so they also require the nss shared libraries. the exact library names vary according to the convention for each platform. for example, the nspr library is called nspr4.dll or libnspr4.dll on windows and libnspr4.so on solaris. ...
...s, so they also require the nss shared libraries. the exact library names vary according to the convention for each platform. for example, the nspr library is called nspr4.dll or libnspr4.dll on windows and libnspr4.so on solaris. the following table gives the core names of the libraries, omitting the platform-specific prefix and suffix. ...
...And 5 more matches
sslfnc.html
as a client, even though it accepted the connection as a tcp server. ssl_handshake_as_server controls the behavior of pr_connect. if this option is off, then pr_connect configures the ssl socket to handshake as a client. if it is on, then pr_connect configures the ssl socket to handshake as a server, even though it connected as a tcp client. ssl_enable_fdx tells the ssl library whether the application will have two threads, one reading and one writing, or just one thread doing reads and writes alternately. the factory setting for this option (which is the default, unless the application changes the default) is off (pr_false), which means that the application will not do simultaneous reads and writes. an application that wishes to do sumultaneous reads and writes should ...
...ons. the ietf standard transport layer security (tls) protocol, rfc 2246, is a modified version of ssl3. it uses the ssl version number 3.1, appearing to be a "minor" revision of ssl 3.0. nss 2.8 supports tls in addition to ssl2 and ssl3. you can think of it as "ssl_enable_ssl3.1". see the description below for more information about this option. ssl_v2_compatible_hello tells the ssl library whether or not to send ssl3 client hello messages in ssl2-compatible format. if set to pr_true, it will; otherwise, it will not. factory setting is on (pr_true). see the description below for more information on this option. ssl_no_cache disallows use of the session cache. factory setting is off. if you turn this option on, this socket will be unable to resume a session begun by anot...
...re not two-way simultaneous, but two-way alternate, also known as "half dupled"; that is, each end takes turns sending, and each end is either sending, or receiving, but not both at the same time. for an application to do full duplex, it would typically have two threads sharing the socket; one doing all the reading and the other doing all the writing. the ssl_enable_fdx option tells the ssl library whether the application will have two threads, one reading and one writing, or just one thread doing reads and writes alternately. ssl_v2_compatible_hello tells the ssl library whether or not to send ssl3 client hello messages in ssl2-compatible format. if an ssl3 client hello message is sent to a server that only understands ssl2 and not ssl3, then the server will interpret the ssl3 client h...
...And 5 more matches
An Overview of XPCOM
atures such as those listed above are provided. gecko although it is in some ways structurally similar to microsoft com, xpcom is designed to be used principally at the application level. the most important use of xpcom is within gecko, an open source, standards compliant, embeddable web browser and toolkit for creating web browsers and other applications. xpcom is the means of accessing gecko library functionality and embedding or extending gecko. this book focuses on the latter - extending gecko - but the fundamental ideas in the book will be important to developers embedding gecko as well. gecko is used in many internet applications, mostly browsers and most notably mozilla firefox. components xpcom allows you to break up large software projects into smaller pieces known as components. t...
...y internet applications, mostly browsers and most notably mozilla firefox. components xpcom allows you to break up large software projects into smaller pieces known as components. they are usually contained in reusable binary libraries (a dll on windows, for example, or a dso on unix), which can include one or more components. when two or more related components are grouped together in a binary library, the library is referred to as a module. modular, component-based programming makes software easier to develop and maintain and has some well-known advantages: benefit description reuse modular code can be reused in other applications and other contexts. updates you can update components without having to recompile the whole application. performance ...
...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, also known as "necko." but it's not always a good idea to divide things up. there are some things in the world that just go together, and others that shouldn't be apart. for example, one author's son will not ea...
...And 5 more matches
Index - Archive of obsolete content
28 private properties people have come up with several ways to emulate private properties using existing language features. this article discusses two common techniques: one using prefixes, the other closures. ...
... eval() to decode the string content into javascript objects. this practice is dangerous and will not, in fact, pass an amo review. so the extension will not be allowed to move out of the amo sandbox. 233 enhanced extension installation add-ons, extensions no summary! 234 extension etiquette add-ons, extensions, guide no summary! 235 extension library no summary! 236 extension packaging add-ons, extensions, guide, toolkit api no summary! 237 extension samples no summary! 238 extension theming guidelines add-ons, extensions this is a set of guidelines on how to control the look and feel of your extension while leaving it open for styling by custom themes. 239 ...
...1 page modifications this documentation is under development. please see the page modifications api proposal for now. 502 extenders no summary! 503 jetpack snippets bits of code that may come in handy. feel free to add your own! 504 libraries namespace: jetpack.lib 505 twitter jetpack's twitter library, jetpack.lib.twitter, is a very simple, lightweight layer on top of twitter's rest api. in fact it's hardly more than syntactic sugar for doing xmlhttprequests. 506 meta no summary! 507 enabling the proposed method for accessing jetpack features that are still in development and may be added in the future is inspired by python's future module. in python...
...And 4 more matches
Using gdb on wimpy computers - Archive of obsolete content
ared libraries. the solution to this is to delay loading shared libraries until they are actually needed. however, you need to make sure that the base libraries like libc and pthreads are loaded before you tell gdb to stop loading shared libraries. if you don't allow those libraries to be loaded then gdb will not be able to properly debug threads on linux. mozilla uses pthreads for its networking library so you need to be able to work in a threaded environment. the best way to do this is to set a breakpoint in main, let the program run until main and then turn off automatic library loading. from there you can allow the program to continue running. here's an example: [blizzard@gunhead mozilla]$ cd dist/bin/ [blizzard@gunhead bin]$ ./mozilla -g .//run-mozilla.sh -g ./mozilla-bin mozilla_five_home=/...
...vironment. the best way to do this is to set a breakpoint in main, let the program run until main and then turn off automatic library loading. from there you can allow the program to continue running. here's an example: [blizzard@gunhead mozilla]$ cd dist/bin/ [blizzard@gunhead bin]$ ./mozilla -g .//run-mozilla.sh -g ./mozilla-bin mozilla_five_home=/home/blizzard/src/mozilla/mozilla/dist/bin ld_library_path=/home/blizzard/src/mozilla/mozilla/dist/bin shlib_path=/home/blizzard/src/mozilla/mozilla/dist/bin libpath=/home/blizzard/src/mozilla/mozilla/dist/bin moz_program=./mozilla-bin moz_toolkit= moz_debug=1 moz_debugger= /usr/bin/gdb ./mozilla-bin -x /tmp/mozargs22288 gnu gdb 19991004 copyright 1998 free software foundation, inc. gdb is free software, cov...
...[0]); (gdb) set auto-solib-add 0 (gdb) c continuing. nsnativecomponentloader: autoregistering begins. [...] it's easy to define a function for gdb to do this for you automatically. you can add this function to the .gdbinit file in your home directory: def prun tbreak main run set auto-solib-add 0 end how do i load shared libraries? if you have turned off automatic shared library loading, you will have to load them when you need them. gdb has a command to load libraries while the program is running. this is the sharedlibrary command. it can be shortened to shar when used in gdb. the argument to the command is a regular expression for the libraries to be loaded. here's what it looks like in the 4.18 version of the debugger: ^c program received signal sigint, interrupt. 0x4...
...And 4 more matches
Implementing feature detection - Learn web development
evious overview: cross browser testing next feature detection involves working out whether a browser supports a certain block of code, and running different code depending on whether it does (or doesn't), so that the browser can always provide a working experience rather than crashing/erroring in some browsers. this article details how to write your own simple feature detection, how to use a library to speed up implementation, and native features for feature detection such as @supports. prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high-level principles of cross-browser testing. objective: to understand what the concept of feature detection is, and be able to implement suitable solutions in css and javascript. the...
...modernizr is the industry standard for feature detection tests, and we'll look at that later on. before we move on, we'd like to say one thing upfront — don't confuse feature detection with browser sniffing (detecting what specific browser is accessing the site) — this is a terrible practice that should be discouraged at all costs. see usin...
...list of undetectables. matchmedia we also wanted to mention the window.matchmedia javascript feature at this point too. this is a property that allows you to run media query tests inside javascript. it looks like this: if (window.matchmedia("(max-width: 480px)").matches) { // run javascript in here. } as an example, our snapshot demo makes use of it to selectively apply the brick javascript library and use it to handle the ui layout, but only for the small screen layout (480px wide or less). we first use the media attribute to only apply the brick css to the page if the page width is 480px or less: <link href="dist/brick.css" type="text/css" rel="stylesheet" media="all and (max-width: 480px)"> we then use matchmedia() in the javascript several times, to only run brick navigation functions...
...And 4 more matches
IPDL Tutorial
see ipdl processes and threads for more details. because protocol messages are represented as c++ metho...
...see ipdl processes and threads for more details. because protocol messages are represented as c++ methods, it's easy to ...
...see ipdl processes and threads for more details. because protocol messages are represented as c++ methods, it's easy to forget that they are in fact asynchronous messages: by default the c++ method will re...
...And 4 more matches
FC_GetInfo
name fc_getinfo - return general information about the pkcs #11 library. syntax ck_rv fc_getinfo(ck_info_ptr pinfo); parameters fc_getinfo has one parameter: pinfo points to a ck_info structure description fc_getinfo returns general information about the pkcs #11 library. on return, the ck_info structure that pinfo points to has the following information: cryptokiversion: pkcs #11 interface version number implemented by the pkcs #11 library. the version is 2.20 (major=0x02, minor=0x14). manufacturerid: the pkcs #11 library manufacturer, "mozilla foundation", padded with spaces to 32 characters and not null-terminated. flags: should be 0. ...
... a user may call fc_getinfo without logging into the token (to assume the nss user role). return value fc_getinfo always returns ckr_ok. ...
..._info structure that pinfo points to has the following information: cryptokiversion: pkcs #11 interface version number implemented by the pkcs #11 library. the version is 2.20 (major=0x02, minor=0x14). manufacturerid: the pkcs #11 library manufacturer, "mozilla foundation", padded with spaces to 32 characters and not null-terminated. flags: should be 0. librarydescription: description of the library, "nss internal crypto services", padded with spaces to 32 characters and not null-terminated. libraryversion: pkcs #11 library version number, for example, 3.11 (major=0x03, minor=0x0b). a user may call fc_getinfo without logging into the token (to assume the nss user role). return value fc_getinfo always returns ckr_ok. fc_getinfo should return ckr_arguments_bad if pinfo is null. fc_getin...
...And 4 more matches
FC_Initialize
summary fc_initialize - initialize the pkcs #11 library. syntax ck_rv fc_initialize(ck_void_ptr pinitargs); parameters pinitargs points to a ck_c_initialize_args structure. description fc_initialize initializes the nss cryptographic module for the fips mode of operation. in addition to creating the internal data structures, it performs the fips software integrity test and power-up self-tests. the pinitargs argument must point to a ck_c_initialize_args structure whose members should have the following values: createmutex should be null. destroymutex should be null. lockmutex should be null. unlockmutex should be null. flags should be ckf_os_locking_ok. ...
...ion. in addition to creating the internal data structures, it performs the fips software integrity test and power-up self-tests. the pinitargs argument must point to a ck_c_initialize_args structure whose members should have the following values: createmutex should be null. destroymutex should be null. lockmutex should be null. unlockmutex should be null. flags should be ckf_os_locking_ok. libraryparameters should point to a string that contains the library parameters. preserved should be null. the library parameters string has this format: "configdir='dir' certprefix='prefix1' keyprefix='prefix2' secmod='file' flags= " here are some examples. nss_nodb_init(""), which initializes nss with no databases: "configdir='' certprefix='' keyprefix='' secmod='' flags=readonly,nocertdb,nomod db,...
... nss with no databases: "configdir='' certprefix='' keyprefix='' secmod='' flags=readonly,nocertdb,nomod db,forceopen,optimizespace " mozilla firefox initializes nss with this string (on windows): "configdir='c:\\documents and settings\\wtc\\application data\\mozilla\\firefox\\profiles\\default.7tt' certprefix='' keyprefix='' secmod='secmod.db' flags=optimizespace manufacturerid='mozilla.org' librarydescription='psm internal crypto services' cryptotokendescription='generic crypto services' dbtokendescription='software security device' cryptoslotdescription='psm internal cryptographic services' dbslotdescription='psm private keys' fipsslotdescription='psm internal fips-140-1 cryptographic services' fipstokendescription='psm fips-140-1 user private key services' minps=0" see pkcs #11 module sp...
...And 4 more matches
NSS Tools modutil
a new pkcs #11 module to the database using the named jar file. use this option with the -installdir and -tempdir arguments. the jar file uses the netscape server pkcs #11 jar format to identify all the files to be installed, the module's name, the mechanism flags, and the cipher flags. the jar file should also contain any files to be installed on the target machine, including the pkcs #11 module library file and other files such as documentation. see the section jar installation file for information on creating the special script needed to perform an installation through a server or with the security module database tool (that is, in environments without javascript support). for general installation instructions and to install a module in environments where javascript support is available (as in...
... module database tool defaults to the user's netscape directory. windows nt has no default directory, so -dbdir must be used to specify a directory. -dbprefix prefix specify the prefix used on the cert8.db and key3.db files (for example, my_cert8.db and my_key3.db). this option is provided as a special case. changing the names of the certificate and key databases is not recommended. -libfile library-file specify a path to the dll or other library file containing the implementation of the pkcs #11 interface module that is being added to the database. -ciphers cipher-enable-list enable specific ciphers in a module that is being added to the database. the cipher-enable-list is a colon-delimited list of cipher names. enclose this list in quotation marks if it contains spaces. the following cip...
...y available: rsa, dsa, rc2, rc4, rc5, des, dh, fortezza, sha1, md5, md2, random (for random number generation), and friendly (meaning certificates are publicly readable). -installdir root-installation-directory specify the root installation directory relative to which files will be installed by the -jar jar-file option. this directory should be one below which it is appropriate to store dynamic library files (for example, a server's root directory or the netscape communicator root directory). -tempdir temporary-directory the temporary directory is the location where temporary files will be created in the course of installation by the -jar jar-file option. if no temporary directory is specified, the current directory will be used. -pwfile old-password-file specify a text file containing a to...
...And 4 more matches
Web Replay
cepted, the wrapped call/message is first performed normally and then it and its outputs are recorded in a data stream for the thread performing the call. during execution of the wrapped call/message, recording of any inner calls is suppressed, so that they are performed normally without affecting the recording. the functions which are intercepted are generally at the system call and the system library level. in general, any function which is not compiled as part of gecko is fair game. acquisition order of locks is recorded in a data stream for each lock. some locks which are associated with non-deterministic components are not recorded, such as the js gc and helper threads locks. accesses on atomic variables/fields are recorded in a global data stream, as if they were all protected by a gl...
...ted yet, as it uses a pretty different rendering path from normal web content. media elements are not supported yet, as many of these run third party multithreaded code which hasn't been tested with the infrastructure. porting almost all implementation work so far has been on macos. windows port work is underway, but is not yet working. the difficulties are in figuring out the set of system library apis to intercept, in getting the memory management and dirty memory parts of the rewind infrastructure to work, and in handling the different graphics and ipc pathways on different platforms. comparison with other projects there is lots of existing work in this area. the closest projects are rr, webkit's replay project, and microsoft's time-travel debugger. compared to rr: this should wor...
...kit apis that can cause js to run or the behavior of js code to vary. broadly, all of these projects sit on a spectrum: at what level is the boundary between components whose behavior is recorded and the rest of the system? rr records all behavior in the user space of a process; the boundary is the system calls which are made into the kernel. this project records all behavior outside of system library calls which the process makes, with exceptions carved out for the allowed non-determinism and for draw targets. microsoft's and webkit's projects record a smaller subset of the browser's behavior. this project is at a good point on this spectrum. compared to a higher level project, this is able to operate on stable, thoroughly documented library apis. by focusing on intercepting these apis, b...
...And 4 more matches
Index
Mozilla › Tech › XPCOM › Index
category image-sniffing-services add-ons, extensions, needscontent in versions of firefox prior to firefox 3, extensions could add decoders for new image types. however, such decoders relied on servers sending correct mime types; images sent with incorrect mime types would not be correctly displayed. 96 xpcom glue guide, xpcom, xpcom glue the xpcom glue is a static library which component developers and embedders can link against. it allows developers to link only against the frozen xpcom method symbols and maintain compatibility with multiple versions of xpcom. 97 xpcom glue without mozalloc starting with xulrunner 2.0, the frozen linkage dependent glue (xpcomglue_s.lib on windows, libxpcomglue_s.a on linux and mac) is dependent on the new in...
...ls you've used have been general, cross-platform, and available in the gecko runtime environment or in any gecko-based application after mozilla 1.2 (when the gre began to be used). 103 component internals obsolete, xpcom let's start by examining how xpcom components are written in c++. the most common type of component is one that is written in c++ and compiled into a shared library (a dll on a windows system or a dso on unix). 104 creating the component code xpcom this chapter goes over the basic code required to handle the relationship between your component and xpcom. having the component found and registered properly is the goal of this first chapter of the tutorial. in the subsequent chapters, we can begin to work on the example weblock component fu...
...ponent will be recognized by xpcom and registered with the category manager so that it starts up when xpcom initializes. when the component starts up, it populates a list of urls read in from a file stored next to the gecko binary on the local system. 106 packaging weblock xpcom in this final part of the tutorial, we'll put all of the pieces of the web locking component - the library itself, the type library, the header file, and the user interface resources - into a package that can be installed on other systems. the first section, component installation overview, describes the general installation process in mozilla. the following sections describe the steps you can take to organize the weblock component for distribution and installation. 107 preface guide, x...
...And 4 more matches
nsILocalFile
enativepath(in acstring relativefilepath); native code only! void appendrelativepath(in astring relativefilepath); acstring getrelativedescriptor(in nsilocalfile fromfile); void initwithfile(in nsilocalfile afile); void initwithnativepath(in acstring filepath); native code only! void initwithpath(in astring filepath); void launch(); prlibrarystar load(); native code only! file openansifiledesc(in string mode); native code only! prfiledescstar opennsprfiledesc(in long flags, in long mode); native code only! void reveal(); void setrelativedescriptor(in nsilocalfile fromfile, in acstring relativedesc); attributes attribute type description diskspaceavailable print64 ...
...platform-specific, full path to a file or directory. exceptions thrown ns_error_file_unrecognized_path indicates that filepath is not an absolute file path or that it contains characters that are invalid for the filesystem. launch() requests that the operating system attempt to open this file. void launch(); parameters none. ...
...wn ns_error_file_unrecognized_path indicates that filepath is not an absolute file path or that it contains characters that are invalid for the filesystem. launch() requests that the operating system attempt to open this file. void launch(); parameters none. native code only! load returns the result of pr_loadlibrary() on the file. the caller is responsible for calling pr_unloadlibrary() on the result. prlibrarystar load(); parameters none. ...
...And 4 more matches
MMgc - Archive of obsolete content
using mmgc managed vs. unmanaged memory mmgc is not only a garbage collector, but a general-purpose memory manager. the flash player uses it for nearly all memory allocations. mmgc can handle both managed and unmanaged memory. managed memory is memory that is reclaimed automatically by the garbage collector. ...
...te operator. another way to think about it: unmanaged memory is c++ operators new and delete managed memory is c++ operator new, with optional delete mmgc contains a page allocator called gcheap, which allocates large blocks (megabytes) of memory from the system and doles out 4kb pages to the unmanaged memory allocator (fixedmalloc) and the managed memory allocator (gc). mmgc namespace the mmgc library is in the c++ namespace mmgc. you can qualify references to classes in the library; for example: mmgc::gc, mmgc::gcfinalizedobject. alternately, you can open the mmgc namespace in your c++ source so that you can refer to the objects more concisely: using namespace mmgc; ... gc* gc = gc::getgc(this); gcobject* gcobject; gc class the class mmgc::gc is the main class of the gc. it represents a ...
...nsidered unreachable and will be destroyed. and you'll be left with dangling pointers to these destroyed objects. if you get a crash dereferencing a pointer to a gc object, and the pointer was a member variable in an unmanaged (non-gc) object, check whether the unmanaged object is a gcroot. if it isn't, maybe it needs to be. finding missing write barriers there are some automatic aids in the mmgc library which can help you find missing write barriers. look in mmgc/gc.cpp. // before sweeping we check for missing write barriers bool gc::incrementalvalidation = false; // check for missing write barriers at every alloc bool gc::incrementalvalidationpedantic = false; if you suspect you have missing write barriers, turn these switches on in a debug build. (the second switch will slow your application...
...And 3 more matches
Mozilla Application Framework in Detail - Archive of obsolete content
, interactive websites, it will already possess a wealth of technical expertise that will be relevant for creating xul applications. in addition to the technologies already mentioned, we go even further by allowing you to even create your own custom interface widgets. don't feel limited by the widgets that the framework already contains! xbl (extensible binding language) allows you to expand your library of interface elements, and even construct your own xml language for defining your ui. for instance imagine that you wanted to create a chess style game. you could easily create xml elements such as <chessboard> or <chesspiece> and via xbl map these to images and application logic. this is very powerful since you could make improvements to the underlying application logic without having to rewrite...
...build customized versions to accommodate their individual needs. free: gecko is free of charge. there is no charge for using the gecko browser engine or gecko technologies, including distributing gecko inside another product. furthermore, when embedding gecko, developers are free to choose what modules to include. there is no requirement for distribution of any other software. the necko network library mozilla's network library (aka necko) provides an extensible, platform-independent api for several layers of networking from transport to presentation layers. its provides a generic and extensible framework for fetching urls with support for common protocols (http, ftp, file, etc.) and a way to plug in custom protocol handlers. necko also provides an abstract "file descriptor" interface for low-l...
...is component object model makes virtually all of the functionality of gecko available as a series of components, or reusable cross-platform libraries, that can be accessed from the browser or scripted from any mozilla application. applications that want to access the various mozilla xpcom libraries (networking, security, dom, etc.) use a special layer of xpcom called xpconnect, which reflects the library interfaces into javascript (or other languages). xpconnect glues the front end to the c++-based components in xpcom, and it can be extended to include scripting support for other languages: pyxpcom already offers support for python, java is supported by javaxpcom, and there are efforts underway to add perl and ruby language support for xpconnect. on the developer side, xpcom lets you to write com...
...And 3 more matches
Getting started with XULRunner - Archive of obsolete content
...
...ile for convenience. note: if you are using firefox build from ubuntuzilla repository, replace /usr/lib/firefox/platform.ini with /opt/firefox/platform.ini. step 2: install xulrunner on windows, unzip the archive someplace reasonable. i unzipped it to a new c:\program files\xulrunner folder. on the mac, extract the tar.bz2 archive, which contains xulrunner as xul.framework. copy this to the /library/frameworks directory, or another location of your choice. on linux, you only need to unpack the archive if you are using a pre-release xulrunner. in all systems you should unzip the omni.ja file into some example directory and take a look at all the awesome! first change the file extension to zip and then use your normal filesystem's decompression tool to open it up. the contents of omni.ja ar...
......
...And 3 more matches
Framework main features - Learn web development
</figure> ); } {props.src}, {props.alt}, and {props.byline} represent where our props will be inserted into the component. to render this component, we would write code like this in the place where we want it rendered (which will probably be inside another component): <authorcredit src="./assets/zelda.png" alt="portrait of zelda schiff" byline="zelda schiff is editor-in-chief of the library times." /> this will ultimately render the following <figure> element in the browser, with its structure as defined in the authorcredit component, and its content as defined in the props included on the authorcredit component call: <figure> <img src="assets/zelda.png" alt="portrait of zelda schiff" > <figcaption> zelda schiff is editor-in-chief of the library times. </figcap...
...cremental dom; it is a separate process through which ember's templates are transpiled into a kind of "byte code" that is easier and faster to read than javascript. routing as mentioned in the previous chapter, routing is an important part of the web experience. to avoid a broken experience in sufficiently complex apps with lots of views, each of the frameworks covered in this module provides a library (or more than one library) that helps developers implement client-side routing in their applications. testing all applications benefit from test coverage that ensures your software continues to behave in the way that you'd expect, and web applications are no different. each framework's ecosystem provides tooling that facilitates the writing of tests. testing tools are not built into the framewo...
...re no different. each framework's ecosystem provides tooling that facilitates the writing of tests. testing tools are not built into the frameworks themselves, but the command-line interface tools used to generate framework apps give you access to the appropriate testing tools. each framework has extensive tools in its ecosystem, with capabilities for unit and integration testing alike. ...
...And 3 more matches
NSS tools : modutil
grity. -jar jar-file add a new pkcs #11 module to the database using the named jar file. use this command with the -installdir and -tempdir arguments. the jar file uses the nss pkcs #11 jar format to identify all the files to be installed, the module's name, the mechanism flags, and the cipher flags, as well as any files to be installed on the target machine, including the pkcs #11 module library file and other files such as documentation. this is covered in the jar installation file section in the man page, which details the special script needed to perform an installation through a server or with modutil. -list [modulename] display basic information about the contents of the secmod.db file. specifying a modulename displays detailed information about a particular module and its sl...
...used on the database files, such as my_ for my_cert8.db. this option is provided as a special case. changing the names of the certificate and key databases is not recommended. -installdir root-installation-directory specify the root installation directory relative to which files will be installed by the -jar option. this directory should be one below which it is appropriate to store dynamic library files, such as a server's root directory. -libfile library-file specify a path to a library file containing the implementation of the pkcs #11 interface module that is being added to the database. -mechanisms mechanism-list specify the security mechanisms for which a particular module will be flagged as a default provider. the mechanism-list is a colon-delimited list of mechanism names. e...
...d. usage and examples creating database files before any operations can be performed, there must be a set of security databases available. modutil can be used to create these files. the only required argument is the database that where the databases will be located. ...
...And 3 more matches
NSS tools : modutil
Mozilla › Projects › NSS › tools › modutil
base using the named jar file. use this command with the -installdir and -tempdir arguments. the jar file uses the nss pkcs #11 jar format to identify all the files to be installed, the module's name, the mechanism flags, and the cipher flags, as well as any files to be installed on the target machine, including the pkcs #11 module library file and other files such as documentation. this is covered in the jar installation file section in the man page, which details the special script needed to perform an installation through a server or with modutil. -list [modulename] display basic information about the contents of the secmod.db file. specifying a modulename displays deta...
... my_cert8.db. this option is provided as a special case. changing the names of the certificate and key databases is not recommended. -installdir root-installation-directory specify the root installation directory relative to which files will be installed by the -jar option. this directory should be one below which it is appropriate to store dynamic library files, such as a server's root directory. -libfile library-file specify a path to a library file containing the implementation of the pkcs #11 interface module that is being added to the database. -mechanisms mechanism-list specify the security mechanisms for which a particular module will be flagged as a default provider. the mecha...
...les creating database files before any operations can be performed, there must be a set of security databases available. modutil can be used to create these files. the only required argument is the database that where the databases will be located. ...
...And 3 more matches
SpiderMonkey Build Documentation
, make sure you have the right build tools for your computer: linux, windows, mac, others. when building a version older than 28, you'll additionally need nspr. and of course, you'll need to get the spidermonkey source code. non-developer (optimized) build use these steps if you want to install spidermonkey for production use or run performance benchmarks. (if you want to use spidermonkey as a library in your c++ application, or work on improving spidermonkey itself, do a developer/debug build instead, as described below.) cd js/src # this name should end with "_opt.obj" to make the version control system ignore it. mkdir build_opt.obj cd build_opt.obj /bin/sh ../configure.in # use "mozmake" on windows make a few notes about this: the most common build problems are dependency problem...
...e this is because, starting from mohave, headers are no longer installed in /usr/include. refer the release notes under command line tools -> new features the release notes also states that this compatibility package will no longer be provided in the near future, so the build system on macos will have to be adapted to look for headers in the sdk until then, the following should help, open /library/developer/commandlinetools/packages/macos_sdk_headers_for_macos_10.14.pk this builds an executable named js in the directory build-release/dist/bin. you can test it with dist/bin/js --help, which displays a help page. at this point, you're ready to run and try out the shell. on mac, linux, or unix, you can install spidermonkey on your system with the additional command make install. this inst...
...ndlinetools/packages/macos_sdk_headers_for_macos_10.14.pk this builds an executable named js in the directory build-release/dist/bin. you can test it with dist/bin/js --help, which displays a help page. at this point, you're ready to run and try out the shell. on mac, linux, or unix, you can install spidermonkey on your system with the additional command make install. this installs the shared library to /usr/local/lib, the c header files to /usr/local/include, and the js executable to/usr/local/bin. developer (debug) build for developing and debugging spidermonkey itself, it is best to have both a debug build (for everyday debugging) and an optimized build (for performance testing), in separate build directories. thus, in addition to following the steps above, you should also create a debug...
...And 3 more matches
Creating the Component Code
sic code required to handle the relationship between your component and xpcom. having the component found and registered properly is the goal of this first chapter of the tutorial. in the subsequent chapters, we can begin to work on the example weblock component functionality itself. use the calculator (after learning long division) you have to write a fair amount of code to create a component library that gets loaded into xpcom. an xpcom component needs to implement at least three interfaces that xpcom requires, and often others as well. there is more code in this chapter than you'll eventually need, however. using xpcom utilities to make things easier shows some simpler and more elegant ways to create an xpcom component using generic macros, and this chapter is more about learning the basics...
... before they can be used. registration is a process that happens in all xpcom applications, whether they're embedded gecko clients, mozilla, netscape 7, compuserve, or any other software that uses xpcom. registration provides the information that applications need in order to use components properly. the weblock component must do a number of things to register itself. specifically, the component library has to contain implementations for the component-related interfaces described in this chapter: nsimodule and nsifactory, which are entry points for your implementation code. once your component implements these interfaces, the rest of the registration process itself is simple. applications typically use regxpcom, described in the next section. the regxpcom program an explicit way to register a...
...t we've looked at the preliminaries, it's time to discuss the classes that this module provides and the way that they define the relationships of the component in xpcom. coding for the registration process when xpcom discovers your component for the first time (via xpinstall or regxpcom, both of which are discussed in component installation overview), the first thing it tries to do is load your library and find the symbol nsgetmodule. when this special entry point is called, it is passed xpcom's component manager and the location of the shared library where your component lives. the component manager is an interface implemented by xpcom that encapsulates the creation of objects and provides summary information about all registered components. the location on disk is passed via another interfac...
...And 3 more matches
Add to iPhoto
majority of the system routines we'll be using come from core foundation. among these are routines for managing cfstring, cfurl, and cfarray objects, among others. these are core system data formats that are used by other frameworks, and we'll be making use of them. ...
...ines we'll be using come from core foundation. among these are routines for managing cfstring, cfurl, and cfarray objects, among others. these are core system data formats that are used by other frameworks, and we'll be making use of them. ...
...ing use of them. the core foundation api is implemented by the corefoundation object, which consists of two methods to initialize and shut down the library, a reference to the library, and all the types and methods declared to support core foundation. ...
...And 3 more matches
Plug-in Basics - Plugins
standing the runtime model, describes these stages in more detail. understanding the runtime model plug-ins are dynamic code modules that are associated with one or more mime types. when the browser starts, it enumerates the available plug-ins (this step varies according to platform), reads resources from each plug-in file to determine the mime types for that plug-in, and registers each plug-in library for its mime types. the following stages outline the life of a plug-in from loading to deletion: when gecko encounters data of a mime type registered for a plug-in (either embedded in an html page or in a separate file), it dynamically loads the plug-in code into memory, if it hasn't been loaded already, and it creates a new instance of the plug-in. gecko calls the plug-in api function np_i...
...irectory. plug-ins within toolkit bundles. profile directory\plugins, where profile directory is a user profile directory. directories pointed to by hkey_current_user\software\mozillaplugins\*\path registry value, where * can be replaced by any name. directories pointed to by hkey_local_machine\software\mozillaplugins\*\path registry value, where * can be replaced by any name. mac os x ~/library/internet plug-ins. /library/internet plug-ins. /system/library/frameworks/javavm.framework/versions/current/resources. plug-ins within toolkit bundles. profile directory/plugins, where profile directory is a user profile directory. linux directory pointed to by moz_plugin_path environment variable. for example: #!/bin/bash export moz_plugin_path=/usr/lib64/mozilla/plugins exec /usr/li...
...f='mymovie.swf'>click here</a> to see a movie."); } } else { // no, so tell them so document.writeln("sorry, can't show you this movie."); } overview of plug-in structure this section is an overview of basic information you will need as you develop plug-ins. understanding the plug-in api plug-ins and platform independence understanding the plug-in api a plug-in is a native code library whose source conforms to standard c syntax. the plug-in application programming interface (api) is made up of two groups of functions and a set of shared data structures. plug-in methods are functions that you implement in the plug-in; gecko calls these functions. the names of all the plug-in functions in the api begin with npp_, for example, npp_new. there are also a couple of functions (i.e.
...And 3 more matches
JXON - Archive of obsolete content
s, for example). in these cases jxon could represent the most practical way. in this article we will show how to convert a parsed xml document (i.e. an instance of document) to a javascript object tree (i.e. a tree of nested instances of object) and viceversa, with some different algorithms. it could be useful to read the xml introduction article first. if you want a complete bidirectional jxon library (modelled on the json global object), skip to the dedicated paragraph (but please read the note about the const statement compatibility). note: if you are interested to address only some parts of an xml document (and are not starting in javascript/json for templating purposes), use xpath instead of converting the whole document into json. conversion snippets now imagine you have this sample xm...
...ne with any kind of xml document. note: despite the term jxon suggesting "lossless" conversions, these techniques are not actually lossless if one needs to preserve ordering of elements, as is common with many xml dialects (including of course xhtml). the ecmascript standard (javascript) indicates that object iteration order is implementation dependent. appendix: a complete, bidirectional, jxon library now we can create a more complete, bidirectional, jxon library based on all our algorithms (see: #1, #2, #3, #4, reverse). its usage is modeled on the json native object. before implementing it in a working environment, please read the note about the const statement compatibility. the following code is also available on github. "use strict"; /*\ |*| |*| jxon framework - copyleft 2011 by mozil...
...rtially supported in opera 9+ and safari. it is not supported in internet explorer 6-9, or in the preview of internet explorer 10. const is going to be defined by ecmascript 6, but with different semantics. similar to variables declared with the let statement, constants declared with const will be block-scoped. we used it only for didactic purpose. if you want a full browser compatibility of this library, please replace all the const statements with the var statements. usage the obtained non-native jxon global object will have two methods: method description jxon.build(document[, verbosity[, freeze[, nesteattributes]]]) returns a javascript object based on the given xml document. jxon.unbuild(objtree[, namespaceuri[, qualifiednamestr[, documenttype]]]) retur...
...And 2 more matches
Mozilla Crypto FAQ - Archive of obsolete content
y in mozilla, and general questions on u.s. regulation of encryption technology. cryptographic functionality in mozilla have all the issues with mozilla and crypto now been resolved? almost. now that the rsa patent is in the public domain, mozilla crypto development can proceed with minimal restrictions. in the near future the mozilla code base will include a complete open source cryptographic library, and mozilla will include ssl support as a standard feature. after the u.s. government relaxed u.s. export regulations in january 2000 to allow export of source code for open source software implementing encryption, the major remaining legal obstacle to mozilla crypto development was the fact that rsa security, inc., held a u.s. patent on the rsa public key algorithm. in february 2000 iplanet e-...
... released the rsa patent into the public domain, two weeks before the patent was scheduled to expire (on september 20, 2000). shortly thereafter the nss developers began work on an open source implementation of the rsa algorithm; that code, together with code previously developed for other cryptographic algorithms, will be included in a new version 3.1 of the nss open source cryptographic and pki library. this new rsa-capable version of nss will then be included in a future version of the open source psm software, which will provide ssl support for mozilla. at that point both nss and psm will be completely buildable using the open source code available from the mozilla.org site, and nss and psm will be included in the mozilla binary releases distributed by mozilla.org. for more information on t...
... full support for ssl and s/mime? the mozilla crypto code will shortly include a full implementation of the rsa and other cryptographic algorithms; that implementation will form the basis of a complete open source ssl implementation for mozilla. s/mime support is also under development, but may not be available in mozilla until after the 1.0 release. version 3.1 of the network security services library will include a complete open source implementation of the cryptographic algorithms needed for mozilla ssl support, including the rsa public key algorithm (now in the public domain). nss 3.1 will be available in beta form in september 2000, with the final release to follow in october 2000. nss 3.1 will be used in the 1.3 release of psm, which will provide a complete open source implementation of s...
...And 2 more matches
Gecko FAQ - Gecko Redirect 1
how does gecko format xml documents? gecko supports the use of css and xslt to format xml documents. for xml documents without associated css or xslt, gecko displays th...
...forts are underway for solaris, hp/ux, aix, irix, os/2, openvms, beos, and amiga, among others. older versions of gecko supported earlier versions of win32 and mac os x. ...
...or solaris, hp/ux, aix, irix, os/2, openvms, beos, and amiga, among others. older versions of gecko supported earlier versions of win32 and mac os x. ...
...And 2 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
rary precision format. in other programming languages different numeric types can exist, for examples: integers, floats, doubles, or bignums. 31 blink glossary, infrastructure, layout, rendering engine blink is an open-source browser layout engine developed by google as part of chromium (and therefore part of chrome as well). specifically, blink began as a fork of the webcore library in webkit, which handles layout, rendering, and dom, but now stands on its own as a separate rendering engine. 32 block disambiguation, glossary the term block can have several meanings depending on the context. it may refer to: 33 block (css) css, codingscripting, design, glossary, html a block on a webpage is an html element that appears on a new line, ...
...-world things, for example a car or map object in a racing game. javascript, java, c++, python, and ruby are examples of object-oriented programming languages. 299 object reference codingscripting, glossary a link to an object. object references can be used exactly like the linked objects. 300 opengl codingscripting, glossary, opengl opengl (open graphics library) is a cross-language, multi-platform application programming interface (api) for rendering 2d and 3d vector graphics. the api is typically used to interact with a graphics processing unit (gpu), to achieve hardware-accelerated rendering. 301 openssl glossary, security openssl is an open-source implementation of ssl and tls. 302 opera browser browser, glossary, ...
... in computer science is the execution of running multiple tasks or programs at the same time. each unit capable of executing code is called a thread. 457 three js browser, codingscripting, javascript, programming language, three.js three.js is a javascript-based webgl engine that can run gpu-powered games and other graphics-powered apps straight from the browser. the three.js library provides many features and apis for drawing 3d scenes in your browser. 458 time to first byte glossary, performance, reference, web performance time to first byte (ttfb) refers to the time between the browser requesting a page and when it receives the first byte of information from the server. this time includes dns lookup and establishing the connection using a tcp handshak...
...And 2 more matches
Multiprocess on Windows
d on an interceptor, the interceptor dispatches a callback that allows us to do whatever we want with that request. our callback implementation forwards the method call to the main thread in order to invoke the method on the wrapped object. the interceptor is also aware that any outparams, which contain interfaces, must also be wrapped with interceptors of their own. this code lives in the mscom library, located in the tree at /ipc/mscom. its headers are exported to mozilla/mscom. ensuring that the interceptor supports your interfaces this information is current, but is likely to change when bug 1346957 is landed. interceptors cannot replicate interfaces without access to the metadata that describes those interfaces. since we are using com, we already generate metadata by declaring interfac...
...346957 is landed. interceptors cannot replicate interfaces without access to the metadata that describes those interfaces. since we are using com, we already generate metadata by declaring interfaces using midl. this does not (yet) work as transparently as we would like. com metadata midl outputs two different types of metadata: "fast format strings" (also known as oicf) and (optionally, if a library statement is included in the idl) type libraries (also known as typelib). oicf metadata is much richer than typelib metadata, however com requires typelibs whenever it is being used with interpreted languages. in particular, typelibs were originally designed to work with 1990s-era visual basic. typelib metadata is limited to supporting the same language features which were supported by vb at that...
... do some additional work to compensate for typelib's weaknesses. the required steps are as follows: ensure that you generate typelibs for all of your com interfaces; ensure that those interfaces are registered; register any outparams that consist of arrays of interfaces. we will now further detail each of these items: generating typelibs for all com interfaces you first need to include a library statement in your idl. when midl processes your idl, it generates c code for building a proxy dll, containing the oicf metadata. it also will output a file with the .tlb extension. this file contains the typelib metadata. both metadata types must be shipped with firefox. the oicf metadata is shipped via the proxy dll. to include the typelib metadata, embed it in the proxy dll's resources. both ty...
...And 2 more matches
NSS sources building testing
getting the source code of network security services (nss), how to build it, and how to run its test suite. getting source code, and a quick overview the easiest way is to download archives of nss releases from mozilla's download server. find the directory that contains the highest version number. because nss depends on the base library nspr, you should download the archive that combines both nss and nspr. if you are a software developer and intend to contribute enhancements to nss, you should obtain the latest development snapshot of nss using mercurial/hg (a distributed source control management tool). in order to get started, anonymous read-only access is sufficient. create a new directory on your computer that you will use as your local work area, and run the following commands. h...
...nspr hg clone https://hg.mozilla.org/projects/nss after the above commands complete, you should have two local directories, named nspr and nss, next to each other. (historical information: nspr and nss source code have recently been re-organized into a new directory structure. in past versions, all files were located in a directory hierarchy that started with the "mozilla" prefix. the nspr base library was located in directory mozilla/nsprpub. the subdirectories dbm, security/dbm, security/coreconf, security/nss were part of the nss sources.) the nss directory contains the following important subdirectories: nss/coreconf contains knowledge for cross platform building. nss/lib contains all the library code that is used to create the runtime libraries used by applications. nss/cmd con...
... important subdirectories: nss/coreconf contains knowledge for cross platform building. nss/lib contains all the library code that is used to create the runtime libraries used by applications. nss/cmd contains a set of various tool programs that are built using nss. several tools are general purpose and can be used to inspect and manipulate the storage files that software using the nss library creates and modifies. other tools are only used for testing purposes. however, all these tools are good examples of how to write software that makes use of the nss library. nss/test this directory contains the nss test suite, which is routinely used to ensure that changes to nss don't introduce regressions. nss/gtests code for nss unit tests running in googletest. it is important to menti...
...And 2 more matches
nss tech note6
t sparc) and 32-bit hp-ux pa-risc (i.e., not itanium, and not 64-bit pa-risc), there are two more .chk files: libfreebl_pure32_3.chk and libfreebl_hybrid_3.chk. the following applies to nss 3.11 : the low-level freebl cryptographic code has been separated from softoken on all platforms. even on platforms for which there is only one implementation of freebl, there is now a separate freebl shared library. ...
...hp-ux pa-risc (i.e., not itanium, and not 64-bit pa-risc), there are two more .chk files: libfreebl_pure32_3.chk and libfreebl_hybrid_3.chk. the following applies to nss 3.11 : the low-level freebl cryptographic code has been separated from softoken on all platforms. even on platforms for which there is only one implementation of freebl, there is now a separate freebl shared library. ...
...32_3.chk and libfreebl_hybrid_3.chk. the following applies to nss 3.11 : the low-level freebl cryptographic code has been separated from softoken on all platforms. even on platforms for which there is only one implementation of freebl, there is now a separate freebl shared library. the freebl library implements a private interface internal to nss. on 32-bit windows and 32-bit os/2, this shared library is called freebl3.dll, and the corresponding .chk file is called freebl3.chk . on 32-bit solaris x86, 64-bit solaris x64 (amd64), 32-bit linux x86, 64-bit linux x86-64, 32-bit aix and 64-bit aix, this shared library is called libfreebl3.so, and the corresponding .chk file is called libfreebl3.chk . on the 32-bit solaris sparc architecture, there are 3 freebl libraries : libfreebl_32int64_3.so fo...
...And 2 more matches
Setting up the Gecko SDK
e windows file names for the executables. application name description of functionality regxpcom.exe registers or unregisters components with xpcom xpidl.exe generates typelib and c++ headers from xpidl xpt_dump.exe prints out information about a given typelib xpt_link.exe combines multiple typelibs into a single typelib library name description of functionality xpcomglue.lib xpcom glue library to be used by xpcom components. building a microsoft visual cpp project once you set up the gecko sdk, you can create a microsoft visual c++ project to handle component development with the sdk. creating a new project after launching visual c++, select new from the file menu. then, from the new dialog, sel...
...functionality xpcomglue.lib xpcom glue library to be used by xpcom components. building a microsoft visual cpp project once you set up the gecko sdk, you can create a microsoft visual c++ project to handle component development with the sdk. creating a new project after launching visual c++, select new from the file menu. then, from the new dialog, select "win32 dynamic-link library". use the fields to the right of the dialog to name your project and set its location. (this example uses "samplegeckoproject" as the project name and c:\ as its location.). (need correction for last visual c++. now it's microsoft visual c++ 2010. express edition is free.) new dialog select ok. ...
... in this dialog, click finish. microsoft studio creates a new project per your specification and presents you with the standard project view. ...
...And 2 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
operty is another xrrigidtransform object which is the inverse of the parent transform. since the xrview representing the view has a transform property which is an xrrigidtransform providing the camera view, you can get the model view matrix—the transform matrix needed to move the world to simulate the desired camera position—like this: let viewmatrix = view.transform.inverse.matrix; if the library you're using accepts an xrrigidtransform object directly, you can instead get view.transform.inverse, rather than pulling out just the array representing the view matrix. composing multiple transforms if your camera needs to be performing multiple transforms simultaneously, such as zooming and panning at the same time, you can multiply the transform matrices together to compose them into a sing...
...sforms if your camera needs to be performing multiple transforms simultaneously, such as zooming and panning at the same time, you can multiply the transform matrices together to compose them into a single matrix that applies both changes at once. see multiplying two matrices in the article matrix math for the web for a clear but readable function that does this or use your preferred matrix math library such as glmatrix to do the work. it's crucial to remember that unlike typical arithmetic, where multiplication is commutative (that is, you get the same answer whether you multiply left to right or right to left), matrix multiplication is not commutative! this is because each transform affects the position of the object and possibly the very coordinate system itself, which can dramatically chang...
... the perspective matrix encapsulates the field of view (technically, this is the vertical field of view), aspect ratio, and the near and far clipping planes within the 4x4 matrix transform, which is then returned to the caller. the near clipping plane is the distance in meters to a plane parallel to the display surface closer than ...
...And 2 more matches
Source code directories overview - Archive of obsolete content
toolkit) which runs on x-windows on unix. motif contains source code for motif, a toolkit which runs on x-windows on unix. os2 contains source code for os/2 warp. rhapsody contains source code for mac os x server (which is based on nextstep which is based on x-windows on unix) using yellow box (cocoa). beos contains source code for beos. qt contains source code for the qt toolkit, a c class library which runs on x-windows on unix, windows 95, windows 98 and window nt 4.0. photon contains source code for photon, a microkernel windowing system used in several real-time operating systems from qnx software systems ltd. seamonkey seamonkey is the development name for the mozilla browser suite. accessible contains code to support microsoft active accessibility and sun's atk accessibility a...
...opers to manipulate the code base and to perform special actions inside makefiles. these programs are used for code level things instead of build level things (which are a stored in the build directory). content was split off from layout and contains objects as they are exposed to the dom. db contains c code for the mdb/mork database which is a low-level, general-purpose and cross-platform file library. it is used to store mail box data, news data and global history data. it has not been updated to support xpcom yet. this code originated in the mozilla classic code base. dbm contains c code for managing, reading and writing hash tables. it is used for the auto-completion feature on the url edit box (stored in netscape.hst in mozilla classic) and for the cached pages index (stored in fat.db in ...
...illa as well as various different companies and individual people. netwerk contains c interfaces and code for low-level access to the network (using sockets and file and memory caches) as well as higher-level access (using various protocols such as http, ftp, gopher, castanet). this code is also known by the names, "netlib" and "necko." nsprpub contains c code for the cross platform "c" runtime library. the "c" runtime library contains basic non-visual c functions to allocate and deallocate memory, get the time and date, read and write files, handle threads and handling and compare strings across all platforms. this code is also known by the name, "nspr" and "netscape portable runtime". this code originated in mozilla classic. other-licenses contains code that does not fall under the mpl, incl...
...refox installer code. locales contains the files that are translated for firefox. themes contains firefox themes. toolkit toolkit is used by the standalone products. components contains the alerts, autocomplete, command line interface, console, cookies, download manager, filepicker, history, password manager, typeaheadfind, view source, etc. content contains xul specific to the toolkit. library contains libxul work. localescontains files that are translated. mozappscontains shared application stuff. obsoletecontains obsolete stuff. profilecontains the profile manager themescontains themes as they relate to toolkit things. xreis the xul runtime engine. this directory contains the code for initializing the toolkit. original document information author(s): daniel howard oth...
Twitter - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development. read the experiment report for what we learned from it and the blog post announcing the first sdk release for what we're up to next! jetpack's twitter library, jetpack.lib.twitter, is a very simple, lightweight layer on top of twitter's rest api. in fact it's hardly more than syntactic sugar for doing xmlhttprequests. to use this library, you therefore need to be familiar with twitter's own api. (it's easy!) methods each method in twitter's api maps to a method here. for example, the twitter method for tweeting, statuses/update, maps to jetpack.lib.twitter.statuses.update(). to call trends/current, use jetpack.lib.twitter.trends.current(). for search, jetpack.lib.twitter.search(). replace slashe...
...trends/current, use jetpack.lib.twitter.trends.current(). for search, jetpack.lib.twitter.search(). replace slashes with dots. most of twitter's methods are supported, but not all. list methods, spam reporting methods, and oauth are not currently supported. if something is not supported but you would like it to be, please file a bug. (or write a patch!) arguments each and every method in the library takes a single argument, an object. there are two styles you can use to define this object. the first is simple: define properties on the object corresponding to the parameters of the twitter method. for instance, some twitter methods have an id parameter, so you would define an id property and set its value to a user's id. (you can read about the parameters of the various methods at twitter's ap...
...ome twitter methods have an id parameter, so you would define an id property and set its value to a user's id. (you can read about the parameters of the various methods at twitter's api reference.) there are two special, optional properties: success and error. success is a function that's called when the request successfully completes, and error is a function called when it fails to complete. the library simply passes them to jquery.ajax(), and so they are called like so: success(data, textstatus) data is twitter's decoded json response. textstatus is a simple string describing the status. error(xmlhttprequest, textstatus, errorthrown) xmlhttprequest is the xhr used in the request. textstatus is a simple string describing the type of error. errorthrown is an exception object, if one was thro...
...cation using the second, more advanced call style described above. or you can simply rely on firefox. when you call a method that requires authentication -- such as jetpack.lib.twitter.statuses.update() -- without providing a username or password, firefox will prompt the user for them if she is not already authenticated with twitter. both methods use http basic authentication. in the future, the library may support oauth. see twitter's authentication documentation for related information. faq see twitter's api faq. since jetpack's twitter library is a very thin wrapper around twitter's api, most everything there applies here, and not much applies here that doesn't apply there. example usage tweeting jetpack.lib.twitter.statuses.update({ status: "o frabjous day!" }); firefox will prompt for ...
Modularization techniques - Archive of obsolete content
void **aresult); // manually registry a factory for a class static nsresult registerfactory(const nscid &aclass, nsifactory *afactory, prbool areplace); // manually registry a dynamically loaded factory for a class static nsresult registerfactory(const nscid &aclass, const char *alibrary, prbool areplace, prbool apersist); // manually unregister a factory for a class static nsresult unregisterfactory(const nscid &aclass, nsifactory *afactory); // manually unregister a dynamically loaded factory for a class static nsresult unregisterfactory(const nscid &aclass, ...
...the most direct is through registerfactory(). registerfactory() supports two different registration mechanisms. the first takes a class id and a pointer to a factory. this mechanism can be used on factories that are linked in...
...libraries(); }; there are several ways a factory can make its way into the repository. the most direct is through registerfactory(). registerfactory() supports two different registration mechanisms. the first takes a class id and a pointer to a factory. this mechanism can be used on factories that are linked into the executable. the second takes a class id and the path to a dynamically loadable library. this mechanism can be used both inside an executable at run-time and externally using the apersist flag to tell the repository to store the class id/library relationship in its permenant store. about nsiids and nscids to simplify the process of dynamically finding, loading and binding interfaces, all classes and interfaces are assigned unique ids. the ids are unique 128 bit numbers that are ba...
...a dll that contains a factory need to define one or two exported functions: // returns the factory associated with the given class id extern "c" ns_export nsresult nsgetfactory(const nscid &acid, nsifactory **afactory); // returns whether the dll can be un...
Deploying XULRunner - Archive of obsolete content
may need to copy "gkmedias.dll" from the xulrunner directory to the root directory mac os x on mac os x, the exact layout of your application bundle depends on which version of xulrunner you're using. xulrunner 39 and later due to mac os x code signing rules and how they interact with the design of xulrunner (see bug 1105044 for the inside scoop), starting with xulrunner 39 the xulrunner library files are no longer able to reside in a xulrunner framework directory. instead, the library files are placed directly into the macos directory alongside the main executable file. here's how the entire application bundle looks: myapp.app/ contents/ info.plist pkginfo resources/ application.ini app_icon.icns components/ ..
...ion.ini app_icon.icns components/ ... components which are part of the application chrome/ ... chrome which is part of the application ... additional application files such as icons, etc macos/ xulrunner (this is the "stub executable"... you should copy this file from /library/frameworks/xul.framework/versions/1.8/xulrunner.) libmozglue.dylib (the main xul library) ... other executables and libraries the core changes to xul and gecko that require this new file layout were implemented in gecko 34, except that the xulrunner application was not updated to know about the change, so it will report an error: "unable to load xpcom."...
...ckground about this change. xulrunner 38 and earlier in xulrunner 38 and earlier, xulrunner is provided in a mac os x framework bundle, which is placed in your application bundle's frameworks directory. the complete bundle structure is as follows: myapp.app/ contents/ info.plist pkginfo frameworks/ xul.framework/ files copied from /library/frameworks/xul.framework/versions/1.8/... make sure you copy all symlinks correctly (use rsync -rl /library/frameworks/xul.framework ...). resources/ application.ini app_icon.icns components/ ... components which are part of the application chrome/ ... chrome which is part of...
...ion.ini app_icon.icns components/ ... components which are part of the application chrome/ ... chrome which is part of the application ... additional application files such as icons, etc macos/ xulrunner (this is the "stub executable"... you should copy this file from /library/frameworks/xul.framework/versions/1.8/xulrunner.) when deploying with xulrunner 2.0, move chrome.manifest to the root directory, and adjust resource paths inside chrome.manifest accordingly. additionally, your mac app will not run without a valid info.plist file. here's a sample one: <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple computer//dt...
Drawing graphics - Learn web development
ork on an experimental 3d canvas implementation. this became webgl, which gained traction among browser vendors, and was standardized around 2009–2010. webgl allows you to create real 3d graphics inside your web browser; the below example shows a simple rotating webgl cube: this article will focus mainly on 2d canvas, as raw webgl code is very complex. we will however show how to use a webgl library to create a 3d scene more easily, and you can find a tutorial covering raw webgl elsewhere — see getting started with webgl. note: basic canvas functionality is supported well across browsers, with the exception of ie 8 and below for 2d canvas, and ie 11 and below for webgl. active learning: getting started with a <canvas> if you want to create a 2d or 3d scene on a web page, you need to s...
...inputs, they will fall back to simple text fields and you'll just have to enter valid color/number values yourself. webgl it's now time to leave 2d behind, and take a quick look at 3d canvas. 3d canvas content is specified using the webgl api, which is a completely separate api from the 2d canvas api, even though they both render onto <canvas> elements. webgl is based on opengl (open graphics library), and allows you to communicate directly with the computer's gpu. as such, writing raw webgl is closer to low level languages such as c++ than regular javascript; it is quite complex but incredibly powerful. using a library because of its complexity, most people write 3d graphics code using a third party javascript library such as three.js, playcanvas, or babylon.js. most of these work in a sim...
...d custom shapes, position viewing cameras and lighting, covering surfaces with textures, and more. they handle the webgl for you, letting you work on a higher level. yes, using one of these means learning another new api (a third party one, in this case), but they are a lot simpler than coding raw webgl. recreating our cube let's look at a simple example of how to create something with a webgl library. we'll choose three.js, as it is one of the most popular ones. in this tutorial we'll create the 3d spinning cube we saw earlier. to start with, make a local copy of index.html in a new folder, then save a copy of metal003.png in the same folder. this is the image we'll use as a surface texture for the cube later on. next, create a new file called main.js, again in the same folder as ...
...this is the image we'll use as a surface texture for the cube later on. next, create a new file called main.js, again in the same folder as before. if you open index.html in your code editor, you'll see that it has two <script> elements — the first one attaching three.min.js to the page, and the second one attaching our main.js file to the page. you need to download the three.min.js library and save it in the same directory as before. now we've got three.js attached to our page, we can start to write javascript that makes use of it into main.js. let's start by creating a new scene — add the following into your main.js file: const scene = new three.scene(); the scene() constructor creates a new scene, which represents the whole 3d world we are trying to display. n...
Runtime Directories
~/.mozilla/firefox/xxxxxxxx.default/ n/d thunderbird os application directory user profile directory temporary directory windows vista/7 c:\program files\mozilla thunderbird\ c:\users\<username>\appdata\roaming\thunderbir...
...files\mozilla firefox\ windows 2000/xp c:\program files\mozilla firefox\ c:\documents and settings\<username>\application data\mozilla\firefox\ (or %appdata%\mozilla\firefox\) c:\documents and settings\<username>\local settings\application data\mozilla\firefox\ os x /applications/firefox.app ~/library/application support/firefox/profiles/xxxxxxxx.default/ ~/library/caches/firefox/profiles/xxxxxxxx.default/ linux ???? ~/.mozilla/firefox/xxxxxxxx.default/ n/d thunderbird os application directory user profile directory temporary directory windows vista/7 c:\program files\mozilla thunderbird\ c:\users\<username>\appdata\roaming\thunderbird\ (or %appdata%\thunderbird\) c:\users\<username>\appdata\lo...
... ~/.thunderbird/xxxxxxxx.default/ (or ~/.mozilla-thunderbird/xxxxxxxx.default/ on debian/ubuntu) n/d see also https://support.mozilla.org/kb/profiles-where-firefox-stores-user-data#w_how-do-i-find-my-profile https://support.mozilla.org/kb/profiles-tb#w_where-i...
... ~/.thunderbird/xxxxxxxx.default/ (or ~/.mozilla-thunderbird/xxxxxxxx.default/ on debian/ubuntu) n/d see also https://support.mozilla.org/kb/profiles-where-firefox-stores-user-data#w_how-do-i-find-my-profile https://support.mozilla.org/kb/profiles-tb#w_where-is-my-profile-stored http://kb.mozillazine.org/profi...
4.3 Release Notes
release date: 01 april 2009 introduction network security services for java (jss) 4.3 is a minor release with the following new features: sqlite-based shareable certificate and key databases libpkix: an rfc 3280 compliant certificate path validation library pkcs11 needslogin method support hmacsha256, hmacsha384, and hmacsha512 support for all nss 3.12 initialization options jss 4.3 is tri-licensed under mpl 1.1/gpl 2.0/lgpl 2.1. new in jss 4.3 a list of bug fixes and enhancement requests were implemented in this release can be obtained by running this bugzilla query jss 4.3 requires nss 3.12 or higher. new sqlite-based shareable certificate and key databases by prepending the string "sql:" to the directory path passed to configdir parameter for crypomanager.initialize ...
...in this release can be obtained by running this bugzilla query jss 4.3 requires nss 3.12 or higher. new sqlite-based shareable certificate and key databases by prepending the string "sql:" to the directory path passed to configdir parameter for crypomanager.initialize method or using the nss environment variable nss_default_db_type. ...
...ha tls_ecdh_anon_with_aes_128_cbc_sha tls_ecdh_anon_with_aes_256_cbc_sha distribution information jss is checked into mozilla/security/jss/. the cvs tag for the jss 4.3 release is jss_4_3_rtm. source tarballs are available from https://archive.mozilla.org/pub/security/jss/releases/jss_4_3_rtm/src/jss-4.3.tar.bz2 binary releases are no longer available on mozilla. jss is a jni library we provide the jss4.jar but expect you to build the jss's matching jni shared library. we provide the jss4.jar in case you do not want to obtain your own jce code signing certificate. jss is a jce provider and therefore the jss4.jar must be signed. https://archive.mozilla.org/pub/security/jss/releases/jss_4_3_rtm/ documentation documentation for jss 4.3 is available as follows: build instr...
...for a list of reported bugs that have not yet been fixed, click here. note that some bugs may have been fixed since jss 4.3 was released. compatibility jss 4.3 is backwards compatible with jss 4.2. applications compiled against jss 4.2 will work with jss 4.3. the 4.3 version of libjss4.so/jss4.dll must only be used with jss4.jar. in general, a jss jar file must be used with the jss shared library from the exact same release. to obtain the version info from the jar file use, "system.out.println(org.mozilla.jss.cryptomanager.jar_jss_version)" and to check the shared library: strings libjss4.so | grep -i header feedback bugs discovered should be reported by filing a bug report with bugzilla. you can also give feedback directly to the developers on the mozilla cryptography forums...
NSS_3.12_release_notes.html
note: firefox 3 uses nss 3.12, but not the new sqlite-based shareable certificate and key databases. we missed the deadline to enable that feature in firefox 3. distribution information the cvs tag for the nss 3.12 release is nss_3_12_rtm. nss 3.12 requires nspr 4.7...
...wnload the nspr 4.7.1 binary distributions to get the nspr 4.7.1 header files and shared libraries, which nss 3.12 requires. nspr 4.7.1 binary distributions are in https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.7.1/. ...
...ions are in https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.7.1/. ...
...t size-optimized in browser builds on linux, windows, and mac bug 90426: use of obsolete typedefs in public nss headers bug 113323: the first argument to pk11_findcertfromnickname should be const. ...
sslintro.html
tdefault. changes default values for all subsequently opened sockets as long as the application is running (compare with ssl_seturl which only configures the socket that is currently open). this function must be called once for each default value that needs to be changed. optional. nss_setdomesticpolicy, nss_setexportpolicy, nss_setfrancepolicy, or ssl_cipherpolicyset. these functions tell the library which cipher suites are permitted by policy (for example, to comply with export restrictions). cipher suites disabled by policy cannot be enabled by user preference. one of these functions must be called before any cryptographic operations can be performed with nss. ssl_cipherprefsetdefault. enables all ciphers chosen by user preference. optional. initializing caches ssl peers frequently ...
...-enabled application typically begins by opening a new socket and then importing the new socket into the ssl environment: pr_newtcpsocket. opens a new socket. a legal nspr socket is required to be passed to ssl_importfd, whether it is created with this function or by another method. ssl_importfd. makes an nspr socket into an ssl socket. required. brings an ordinary nspr socket into the ssl library, returning a new nspr socket that can be used to make ssl calls. you can pass this function a model file descriptor to create the new ssl socket with the same configuration state as the model. it is also possible for an application to import a socket into ssl after the tcp connection on that socket has already been established. in this case, initial configuration takes place in the same way: pa...
...e handshake occurs automatically the first time communication is requested with a socket read/write or send/receive call. it is also possible to force the handshake explicitly with ssl_forcehandshake or repeat it explicitly with ssl_rehandshake. once the ssl sockets have been configured, authentication and encryption happen automatically whenever you use the communication functions from the nspr library. a server application typically uses these functions to establish a connection: pr_bind pr_listen pr_accept pr_getsockname a client application typically uses these functions to establish a connection: pr_gethostbyname pr_enumeratehostent pr_connect pr_getconnectstatus when an application imports a socket into ssl after the tcp connection on that socket has already been establi...
... the client. at the http protocol level, nothing more is being said (that is, no http request or response is being sent), so the server first uses ssl_rehandshake to begin a new handshake and then call ssl_forcehandshake to drive the handshake to completion. functions used by callbacks an ssl application typically provides one or more callback functions that are called by the ssl or pkcs #11 library code under certain circumstances. numerous functions provided by the nss libraries are useful for such application callback functions, including these: cert_checkcertvalidtimes cert_getdefaultcertdb cert_destroycertificate cert_dupcertificate cert_findcertbyname cert_freenicknames cert_getcertnicknames cert_verifycertname cert_verifycertnow pk11_findcertfromnickname pk11_fin...
Rebranding SpiderMonkey (1.8.5)
g. this time paying careful attention to the commands you issue to your command shell. the above command has actually changed some information we need changed back so we will re-issue the recursive find and replace text in files command with some modifications. find ./ -type f -exec sed -i "s/$brand.pc/mozjs185.pc/" {} \; the last recursive search and replace, changes the file name of the static library: find ./ -type f -exec sed -i "s/js_static/$brand_static/" {} \; allright, almost there. now comes the manual editing. using your favorite editor open up the file named makefile for editing. search for this text: mozjs185.pc "scroll down" a few lines until you see this line: > $@ && chmod 644 $@ that line should be modified to read back: > $brand.pc && chmod 644 $brand.pc "scroll dow...
...e manual editing process, this has been discouraged due to the fact that these files are automatically generated and very little constant data can be depended upon. it also allows these instructions to apply to a wide range platforms without introducing more software dependencies. save the file and exit the editor. you may now perform the build and installation of your custom branded spidermonkey library: make note: depending on your system you may need administrative rights to perform the installation: make install the following information isn't technically needed for using your library but it will help other applications use your library. your rebranded library has been succesfully built and installed to libdir as specified in ./config/autoconf.mk. a pkgconfig file has also been installed fo...
... the script file js-config has not been modified either and still points to mozjs185. ...
... the script file js-config has not been modified either and still points to mozjs185. if this is not desirable, you can issue the following command on unix systems: sed -i "s/mozjs185/$brand/" /usr/bin/js-config which performs a simple text replacement of mozjs185 with your branding on the js-config script. ...
XPCOM glue
Mozilla › Tech › XPCOM › Glue
it allows developers to link only against the frozen xpcom method symbols and maintain compatibility with multiple versions of xpcom. compiling or linking against xpcom headers there are three ways to compile/link against xpcom headers/libraries: frozen linkage: dependent glue (dependent on xpcom.dll) xpcom modules, i.e. extension or xulrunner application components, should use the dependent glue. code which wishes to use only frozen symbols but can tolerate a load-time dependency on xpcom.dll should link against xpcomglue_s.lib and xpcom.lib. it should not link against xpcom_core.lib. ...
...ng, and link against xpcomglue.lib. it should not link against xpcomglue_s.lib or xpcom.lib. embedders using the standalone glue typically also need to avoid linking against nspr as well. however, when using threadsafe together with the glue libraries from gecko 1.8 or later, a special step needs to be taken to use ns_impl_threadsafe_isupportsn. ...
... internal linkage will be unavailable to extension authors in xulrunner 1.9 (firefox 3) because the nonfrozen symbols will not be exported from libxul. ...
... -l/path/to/sdk/lib -lxpcomglue notes never link against xpcomglue.lib and xpcomglue_s...
How to build an XPCOM component in JavaScript
idl sources xpidlsrcs = \ helloworld.idl \ $(null) include $(topsrcdir)/config/rules.mk xpidl_flags += \ -i$(topsrcdir)/dom/interfaces/base \ -i$(topsrcdir)/dom/interfaces/events \ $(null) creating the component using xpcomutils in firefox 3 and later you can use import xpcomutils.jsm using components.utils.import to simplify the process of writing your component slightly. ...
...g the component using xpcomutils in firefox 3 and later you can use import xpcomutils.jsm using components.utils.import to simplify the process of writing your component slightly. the imported library contains functions for generating the module, factory, and the nsgetmodule and queryinterface functions for you. note: it doesn't do the work of creating your interface definition file or the type library for you, so you still have to go through those steps above if they haven't been done. ...
...components.utils.import to simplify the process of writing your component slightly. the imported library contains functions for generating the module, factory, and the nsgetmodule and queryinterface functions for you. note: it doesn't do the work of creating your interface definition file or the type library for you, so you still have to go through those steps above if they haven't been done. the library provides a simple example of its use in the source code (js/xpconnect/loader/xpcomutils.jsm), but here's another using this example. ...
...te: it doesn't do the work of creating your interface definition file or the type library for you, so you still have to go through those steps above if they haven't been done. the library provides a simple example of its use in the source code (js/xpconnect/loader/xpcomutils.jsm), but here's another using this example. ...
Starting WebLock
spell it all out, in other words. and it's this formality that makes the interfaces in xpcom effective contracts between services and clients. the next section shows the interface of the weblock component, iweblock, in xpidl. once the interface has been described in the xpidl language, the interface file can be used to generate the header files needed for the implementation code, the binary type library files that let you use the interface of the weblock component from javascript, and even broken linkjavadoc style html documentation. defining the weblock interface in xpidl most interfaces in the xpcom world are described in xpidl. the xpidl file for the iweblock interface can be used to generate the c++ header file, which you'll need to implement the interface in the component and also a type ...
... files that let you use the interface of the weblock component from javascript, and even broken linkjavadoc style html documentation. defining the weblock interface in xpidl most interfaces in the xpcom world are described in xpidl. the xpidl file for the iweblock interface can be used to generate the c++ header file, which you'll need to implement the interface in the component and also a type library that makes the component accessible from javascript or other interpreted languages. in mozilla, javascript is the bridge between components and the xul-based user interface. the xpidl syntax the xpidl syntax is a mix of c++ and java, and of course it's very much like the omg idl upon which it is closely based. the xpidl for iweblock appears below: iweblock #include "nsisupports.idl" interface ...
...djusts the thefile object representing that file: nsembedcstring filename("weblock.txt"); appdir->appendnative(filename); manipulating files with nsifile once you have an nsifile object pointing to the file that you're interested in, you can open it and read its contents into memory. there are many ways to do this: you can use standard ansi file i/o, or nspr (see the netscape portable runtime library below for a brief description of nspr), or you can use the networking apis that gecko provides. the netscape portable runtime library thenetscape portable runtime library (nspr) is a platform-independent library that sits below xpcom. as a layer of abstraction above the operating system, the nspr allows gecko applications to be platform independent by providing the following system-level facil...
... to keep things as simple as possible, we'll read the file into memory using standard ansi file i/o, but for examples and information about how to usenecko, the gecko networking libraries, see http://www.mozilla.org/projects/netlib/. ...
Troubleshooting XPCOM components registration
you can be certain that a component has failed to register by going to the error console and evaluating components.classes["contract-id"].name where contract-id is your contract id. ...
...you can be certain that a component has failed to register by going to the error console and evaluating components.classes["contract-id"].name where contract-id is your contract id. ...
...lly copy these dependencies to firefox.exe's directory, to windows\system32, or to any directory is the system's path. a google groups thread on the matter is located here. the dllmain code that msvc 8 (and probably earlier versions too) generates for you doesn't need to be there, you can remove it. ...
... use strace to see if firefox is trying to load your components. pass the -wl,-z,defs flag to gcc when linking your component. this will ensure that undefined symbols show an error at link time instead of failing at run time. ...
XPCOM
to a different platform. often, compiled xpcom components are called 'binary' or 'native'.xpcom category image-sniffing-servicesin versions of firefox prior to firefox 3, extensions could add decoders for new image types. however, such decoders relied on servers sending correct mime types; images sent with incorrect mime types would not be correctly displayed.xpcom gluethe xpcom glue is a static library which component developers and embedders can link against. it allows developers to link only against the frozen xpcom method symbols and maintain compatibility with multiple versions of xpcom.xpcom guidethese articles provide tutorials and usage documentation for xpcom, including how to use it in your own projects and how to build xpcom components for your firefox add-ons and the like.xpcom owner...
...how to build xpcom components for your firefox add-ons and the like.xpcom ownership guidelines...naturally. if you create a temporary object, obviously it's up to you to destroy it. that's a sure sign of ownership. if you create an object with a longer lifespan, you will own it until you give ownership away.xpcom referencethis 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.xpcom tasksthe xpcom module roughly parallels the c/c++ standard libraries. it overlaps them significantly, but goes beyond them in capabilities. xpcom s...
...com in other projects.xpcom tasksthe xpcom module roughly parallels the c/c++ standard libraries. it overlaps them significantly, but goes beyond them in capabilities. xpcom sits above the standard libraries. its role is to extend them with facilities tailored to xpcom development in general, and specifically the needs of mozilla. like the standard libraries, xpcom must be a fairly self-contained library, so as not to encumber clients with any unnecessary external dependencies.xpcom thread synchronizationxpcom thread synchronization primitives have the same semantics as those in nspr, and each method of these synchronization objects (e.g. mutex::lock()) has a matching function in nspr (pr_lock()). this is no accident, as mozilla:: primitives are merely bare-minimum wrappers around nspr's.xptcall ...
...ry external dependencies.xpcom thread synchronizationxpcom thread synchronization primitives have the same semantics as those in nspr, and each method of these synchronization objects (e.g. mutex::lock()) has a matching function in nspr (pr_lock()). this is no accident, as mozilla:: primitives are merely bare-minimum wrappers around nspr's.xptcall faqxptcall is a small low level xpcom method call library. it is implemented using platform specific c/c++ and assembly language code. it is used to facilitate cross language and cross thread method calls. porting this code is required in order to make mozilla run on any given platform.xptcall porting guideoriginal author: john bandhauer, 31 may 1999.xptcall porting statusthis is a status page for the multiplatform porting of xptcall. xptcall has a faq ...
Index - Web APIs
Web › API › Index
nt, html dom, js, needsmarkupwork, reference, storage, cookie the document property cookie lets you read and write cookies associated with the document. it serves as a getter and setter for the actual values of the cookies. 877 simple cookie framework cookies, cookie as cookies are just specially formatted strings it is sometimes difficult to manage them. the following library aims to abstract the access to document.cookie by defining an object (doccookies) that is partially consistent with a storage object. it also offers full unicode support. 878 document.createattribute() api, dom, method, reference the document.createattribute() method creates a new attribute node, and returns it. the object created a node implementing the attr interface. the d...
...djacent to the node. 4231 textdecoder api, dom, encoding, experimental, interface, reference, textdecoder the textdecoder interface represents a decoder for a specific method—that is, a specific character encoding—such as utf-8, iso-8859-2, koi8, cp1261, gbk, etc. a decoder takes a stream of bytes as input and emits a stream of code points. for a more scalable, non-native library, see stringview – a c-like representation of strings based on typed arrays. 4232 textdecoder() api, constructor, encoding, experimental, reference, textdecoder the textdecoder() constructor returns a newly created textdecoder object for the encoding specified in parameter. 4233 textdecoder.prototype.decode() api, encoding, experimental, method, textdecoder ...
...operty, read-only, textdecoder the textdecoder.prototype.encoding read-only property returns a domstring containing the name of the decoding algorithm used by the specific decoder. 4235 textencoder api, encoding, experimental, interface, reference, textencoder textencoder takes a stream of code points as input and emits a stream of bytes. for a more scalable, non-native library, see stringview – a c-like representation of strings based on typed arrays. 4236 textencoder() api, constructor, encoding, reference, textencoder the textencoder() constructor returns a newly created utf-8 textencoder object. 4237 textencoder.encoding api, encoding, property, read-only, reference, textencoder the textencoder.encoding read-only property ...
...et of mipmaps for a webgltexture object. 4781 webglrenderingcontext.getactiveattrib() api, method, reference, webgl, webglrenderingcontext the webglrenderingcontext.getactiveattrib() method of the webgl api returns a webglactiveinfo object containing size, type, and name of a vertex attribute. it is generally used when querying unknown uniforms either for debugging or generic library creation. 4782 webglrenderingcontext.getactiveuniform() api, method, reference, webgl, webglrenderingcontext the webglrenderingcontext.getactiveuniform() method of the webgl api returns a webglactiveinfo object containing size, type, and name of a uniform attribute. it is generally used when querying unknown uniforms either for debugging or generic library creation. 47...
Web audio codec guide - Web media technologies
online vendors including itunes. aac has a number of profiles that define methods of compressing audio for specific use cases, including everything from high quality surround sound to low-fidelity audio for speech-only use. as a patent-encumbered format, aac support is somewhat less predictable. for example, firefox only supports aac if support is provided by the operating system or an external library. supported bit rates arbitrary, up to 512 kbps variable bit rate (vbr) support yes supported sample formats 32-bit integer supported sample rates 8 khz - 96 khz recommended minimum bit rate for stereo sound 96 kbps at 48 khz sample rate compression lossy maximum audio channels 48 (plus 16 low frequency enhancemen...
... or distributing aac-encoded content: no license required; developers of codecs are required to obtain a patent license through via licensing [1] due to patent issues, firefox does not directly support aac. instead, firefox relies upon a platform's native support for aac. this capability was introduced on each platform in different firefox releases: aac support in firefox using external library, by platform platform first firefox version with aac support windows (vista and later) 22 android 20 linux (depends on gstreamer) 26 macos 35 [2] chrome supports aac only in mp4 containers, and only supports aac's main profile. in addition, aac is not available in chromium builds. alac (apple lossless audio codec) the app...
...mpatible no licensing patent-free in the eu as of 2012; patent-free in the united states as of april 16, 2017; now free to use [1] for patent reasons, firefox did not directly support mp3 prior to version 71; instead, platform-native libraries were used to support mp3. this capability was introduced on each platform in different firefox releases: mp3 support with external library, by platform, in firefox platform first firefox version with mp3 support windows (vista and later) 22 android 20 linux (depends on gstreamer) 26 macos 35 opus the opus audio format was created by the xiph.org foundation as a fully open audio format; it has been standardized by ietf as rfc 6716. it's a good general-purpose...
.... firefox doesn't support mp4 als. in this case, it appears that flac is most likely the best codec to go with; alac has little to no direct browser support. audio encoding software there are many tools available for encoding audio. the simplest are those which are meant for ripping cds or pulling in audio files and quickly and automatically converting them to mp3 or aac format to store in a library, such as itunes. but when developing web apps that use audio as a component of the app, such as games, you will need more control over the encoding process and more options surrounding the format used while encoding the audio. a few popular options: ffmpeg arguably the best-known and most widely regarded open source codec packages available, ffmpeg supports the majority of the most popular a...
Index of archived content - Archive of obsolete content
lf contributor's guide classes and inheritance content processes getting started modules private properties firefox compatibility module structure of the sdk porting the library detector program id sdk api lifecycle sdk and xul comparison testing the add-on sdk two types of scripts working with events xul migration guide high-level apis addon-page base64 clipboard ...
...efox extensions with the mozilla build system custom about: urls default preferences deploying a plugin as an extension developing add-ons displaying web content in an extension without security issues downloading json and javascript in extensions enhanced extension installation extension etiquette extension library extension packaging extension samples extension theming guidelines extension versioning, update and compatibility extensions support in seamonkey 2 firefox addons developer guide hiding browser chrome hotfix extension how to convert an overlay extension to restartless inline options insta...
... plug-n-hack plug-n-hack get involved plug-n-hack phase1 plug-n-hack phase2 plug-n-hack tools supported plugin architecture porting nspr to unix platforms priority content prism blogposts build bundlelibrary bundles configuration extensions faq hostwindow installer scripting styling proxy ui pydom rdf api rdf datasource how-to reading textual data remote xul remote debugging rsyncing the cvs repository ...
List of Mozilla-Based Applications - Archive of obsolete content
emusic download manager music downloader for emusic emusic remote music manager enlis genome personal genome browser esxx javascript application server uses mozilla rhino etna xml wysiwyg editor eudora mail and news application the upcoming version 8 will be based on thunderbird evergreen library automation system evolution email client uses nss exe elearning xhtml editor seems to be using xul for some of their webui facebook open platform facebook open platform the fbml parser used in the platform is based on mozilla code fennec browser for mobiles as mark notes: fennec is not firefox, it’s a completely different applicati...
...xulrunner application itsnat java ajax component based web framework java software platform uses mozilla rhino javalikescript javascript extensible tooling framework uses nspr and spidermonkey jaxer ajax server jslibs javascript development runtime environment uses spidermonkey (note: this is separate from the javascript library jslib) joybidder ebay auction tool standalone version uses xulrunner just (fr) audio a tool for setting temporal tags in audio documents jsdoc toolkit documentation tool uses mozilla rhino k-meleon gecko-based web browser for windows embeds gecko in mfc kairo.at mandelbrot creates images of mandelbrot sets xulrunner applic...
...ploader is a xulrunner application that runs headless in xvfb wikipediaondvd and wikimedia by moulin offline versions of wikipedia blog post about projects wine implementation of the windows api uses mozilla spidermonkey and the gecko activex control worksmart.net suite of web-based workplace apps uses prism wxwebconnect web browser control library wyzo browser xb browser anonymous web browser xbusiness create and send branded invoices, quotes or estimates xdf billing and quotes software xiphos bible study software xmldbeditor database editor xpud linux desktop xpud: linux with an xul interface, 10 second boot time xra...
Building Firefox with Rust code - Archive of obsolete content
e generally target stable rust, but sometimes issues temporarily require a beta or custom toolchain build. our goal is to always ship a firefox release build with a stable rust toolchain release. if you don't have rust already, use the rustup tool to install it and update as new releases become available, or use the ./mach bootstrap command. the build system will generate a special 'rust unified library' crate, compiled to a static library (libgkrust.a) which is in turn linked into xul, so all public symbols will be available to c++ code. if you have new rust libraries that code in libxul calls directly, then you should add the appropriate extern crate lines in toolkit/library/rust/shared/lib.rs, and add those libraries (crates) as dependencies in toolkit/library/rust/cargo.toml. if you want to...
... xul, so all public symbols will be available to c++ code. if you have new rust libraries that code in libxul calls directly, then you should add the appropriate extern crate lines in toolkit/library/rust/shared/lib.rs, and add those libraries (crates) as dependencies in toolkit/library/rust/cargo.toml. if you want to call code in the "e10s" crate, you would add: extern crate e10s; to toolkit/library/rust/shared/lib.rs; you would also need to specify the path to that crate in the dependencies section of toolkit/library/rust/shared/cargo.toml: [dependencies] e10s = { path = "../../../../path/from/srcdir/e10s" } the e10s crate must also be checked into the tree at the appropriate path. if the e10s crate depends on any other crates, their sources must also be checked into the tree, and e10s's...
...ttributes for each of its dependencies, and so on. this is automated by the mach vendor command, which installs the dependencies in third_party/rust. be sure the licenses of all dependent crates are compatible. cargo.lock files have also been checked in, so you will need to update those as well when appropriate. crates for unit tests can be added in a similar fashion to the files in toolkit/library/gtest/rust/. if your crate has optional features that aren't normally turned on, you are strongly encouraged to remove dependencies for those features when importing code so the build system doesn't require that (unused) code to live in-tree. the build system will check that there's only one copy of a given crate in a build; this was a deliberate decision to try and avoid code bloat in libx...
The Joy of XUL - Archive of obsolete content
e cool toolkit and xul runner features case study: a mozilla calendar application this mini case study describes how oeone corporation (now part of hipplay; this calendar application is no longer listed on their site) integrated its calendar application with the core mozilla product. the calendar application is comprised of a xul front end and an xpcom component that leverages libical, a native library written in c, for date operations and calendar data storage. the calendar was initially developed exclusively for linux but was successfully ported to both macintosh and windows within a week. xul provides a rich set of ui components.the user interface for the calendar is written entirely in xul, javascript, and css, which is a testament to the power and flexibility of this application building ...
...eeks, days, and months. the initial implementation of calendar did not exploit xbl because the developers involved were not experienced with this complementary technology. but future plans for the calendar include converting many of these ui components to xbl widgets to further simplify their implementation. xpcom/xpconnect enables integration of native code.a fully-featured open source calendar library, libical, was harvested for the calendar project. libical is an open source implementation of the ietf's icalendar calendaring and scheduling protocols (rfc 2445, rfc 2446, and rfc 2447). it parses ical components and provides a c api for manipulating the component properties, parameters, and subcomponents. the library was initially integrated by writing an xpcom wrapper to adapt its interface. t...
...eloper (oeone corporation) contributed the source to the mozilla project, the calendar had to be migrated to the windows and macintosh platforms. the ui for the xul application required zero porting effort because it worked with almost no alteration on both new platforms. similarly, since the ui code is written in javascript, the interaction logic worked with no effort. however, since the libical library is written in c, more significant effort was required to migrate this component to the other platforms. fortunately, an implementation of the libical library was already available for macintosh so, with the cross platform nature of xpcom, a macintosh calendar implementation was working within a few days. however, there was no existing win32 port available, so developers had to undertake a portin...
NPN_SetValue - Archive of obsolete content
returns if successful, the function should return nperr_no_error. if unsuccessful, the function should return the most relevant npapi error code. for possible val...
... npn_setvalue with nppvplugintransparentbool for the variable parameter and false for the value parameter. to specify a transparent mode, the value parameter should be set to true. nppvjavascriptpushcallerbool sets whether you are pushing or popping the appropriate jscontext off the stack (see the two-way scriptability article on the mozilla plugins project page for more details). nppvpluginkeeplibraryinmemory specifies that the plugin does not want to be unloaded from memory after the page which initiated it has gone. normally, when the browser navigates away from the page containing the plugin, all plugin instances get an npp_destroy call, and if there are no more instances of the plugin active, the plugin calls its np_shutdown method and the plugin dll gets unloaded from memory. if this is n...
...ll, and if there are no more instances of the plugin active, the plugin calls its np_shutdown method and the plugin dll gets unloaded from memory. if this is not desired, the plugin can instruct the browser not to unload the dll and not to call np_shutdown when the page is left. in such a case all this will be done on the browser shutdown. the plugin calls npn_setvalue any time with nppvpluginkeeplibraryinmemory as variable parameter and value set to true. by default, the dll will be unloaded from memory preceded by an np_shutdown call. remarks all four variable values are boolean. although the function prototype has type of value void *, the actual boolean should be placed there, not a pointer to a boolean. the browser code reads this parameter as follows (nppvpluginwindowbool as an example): ...
Building up a basic demo with Babylon.js - Game development
in this article we'll take you through the real basics of using babylon.js, including setting up a development environment, structuring the necessary html, and writing the javascript code. we will try to create a simple demo first — a cube rendered on the screen. ...
... canvas = document.getelementbyid("render-canvas"); /* all our javascript code goes here */ </script> </body> </html> it contains some basic information like the document <title>, and some css to set the width and height of the <canvas> element (which babylon.js will use to render the content on) to fill the entire available viewport space. the first <script> element includes the babylon.js library in the page; we will write our example code in the second one. there is one helper variable already included, which will store a reference to the <canvas> element. before reading on, copy this code to a new text file and save it in your working directory as index.html. initialising the babylon.js engine we have to create a babylon.js engine instance first (passing it the <canvas> element to re...
... freecamera is the most basic and universal one. to initialize it you need to pass it three parameters: any name you want to use for it, the coordinates where you want it to be positioned in the 3d space, and the scene you want to add it to. note: you probably noticed the babylon.vector3() method in use here — this defines a 3d position on the scene. babylon.js is bundled with a complete math library for handling vectors, colors, matrices etc. let there be light there are various light sources available in babylon.js. the most basic one is the pointlight, which works like a flashlight — shining a spotlight in a given direction. add the following line below your camera definition: var light = new babylon.pointlight("light", new babylon.vector3(10, 10, 0), scene); the parameters are ve...
Building up a basic demo with Three.js - Game development
a typical 3d scene in a game — even the simplest one — contains standard items like shapes located in a coordinate system, a camera to actually see them, lights and materials to make it look better, animations to make it look alive, etc. three.js, as with any other 3d library, provides built-in helper functions to help you implement common 3d functionality more quickly. ...
...uickly. in this article we'll take you through the real basics of using three, including setting up a development environment, structuring the necessary html, the fundamental objects of three, and how to build up a basic demo. note: we chose three because it is one of the most popular webgl libraries, and it is easy to get started with. we are not trying to say it is better than any other webgl library available, and you should feel free to try another library, such as copperlicht, glge, or playcanvas. environment setup to start developing with three.js, you don't need much. you should: make sure you are using a modern browser with good webgl support, such as the latest firefox or chrome. create a directory to store your experiments in. save a copy of the latest minimized three.js libra...
...r width = window.innerwidth; var height = window.innerheight; /* all our javascript code goes here */ </script> </body> </html> it contains some basic information like the document <title>, and some css to set the width and height of the <canvas> element, that three.js will insert on the page to 100% to fill the entire available viewport space. the first <script> element includes the three.js library in the page, and we will write our example code inside the second. there are two helper variables already included, which store the window's width and height. before reading further, copy this code to a new text file, and save it in your working directory as index.html. renderer a renderer is a tool which displays scenes right in your browser. there are a few different renderers: webgl is the ...
GLSL Shaders - Game development
olor variable. gl_fragcolor is a built-in glsl variable like gl_position. the calculations result in a variable containing the information about the rgba color. demo let's build a simple demo to explain those shaders in action. be sure to read three.js tutorial first to grasp the concept of the scene, its objects, and materials. note: remember that you don't have to use three.js or any other library to write your shaders — pure webgl (web graphics library) is more than enough. we've used three.js here to make the background code a lot simpler and clearer to understand, so you can just focus on the shader code. three.js and other 3d libraries abstract a lot of things for you — if you wanted to create such an example in raw webgl, you'd have to write a lot of extra code to actually make it...
...nted to create such an example in raw webgl, you'd have to write a lot of extra code to actually make it work. environment setup to start with the webgl shaders you don't need much. you should: make sure you are using a modern browser with good webgl support, such as the latest firefox or chrome. create a directory to store your experiments in. save a copy of the latest minimized three.js library inside your directory. html structure here's the html structure we will use. <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: shaders demo</title> <style> body { margin: 0; padding: 0; font-size: 0; } canvas { width: 100%; height: 100%; } </style> <script src="three.min.js"></script> </head> <body> <script id="vertexshader" type="x-shader/x-vertex"> // vertex...
...e="x-shader/x-fragment"> // fragment shader's code goes here </script> <script> // scene setup goes here </script> </body> </html> it contains some basic information like the document <title>, and some css to set the width and height of the <canvas> element that three.js will insert on the page to be the full size of the viewport. the <script> element in the <head> includes the three.js library in the page; we will write our code into three script tags in the <body> tag: the first one will contain the vertex shader. the second one will contain the fragment shader. the third one will contain the actual javascript code generating the scene. before reading on, copy this code to a new text file and save it in your working directory as index.html. we'll create a scene featuring a simp...
3D games on the Web - Game development
et more advanced (see our webgl documentation to get started.) for real-world projects you'll probably also make use of a framework to speed up development and help you manage the project you're working on. using a framework for 3d games also helps optimize the performance as a lot is taken care of by the tools you use, so you can focus on building the game itself. the most popular javascript 3d library is three.js, a multi-purpose tool that makes common 3d techniques simpler to implement. there are other popular game development libraries and frameworks worth checking too; a-frame, playcanvas and babylon.js are among the most recognizable ones with rich documentation, online editors and active communities. building up a basic demo with a-frame a-frame is a web framework for building 3d and vr...
...g 3d and vr experiences. under the hood, it is a three.js framework with a declarative entity-component pattern, meaning we can build scenes with just html. see the building up a basic demo with a-frame subpage for the step-by-step process of creating the demo. building up a basic demo with babylon.js babylon.js is one of the most popular 3d game engines used by developers. as with any other 3d library, it provides built-in functions to help you implement common 3d functionality more quickly. see the building up a basic demo with babylon.js subpage for the basics of using babylon.js, including setting up a development environment, structuring the necessary html, and writing the javascript code. building up a basic demo with playcanvas playcanvas is a popular 3d webgl game engine open-sourced ...
... environment, structuring the necessary html, and writing the javascript code. building up a basic demo with playcanvas playcanvas is a popular 3d webgl game engine open-sourced on github, with an editor available online and good documentation. see the building up a basic demo with playcanvas subpage for higher-level details, and further articles showing how to create demos using the playcanvas library, and the online editor. building up a basic demo with three.js three.js, like any other library, gives you a huge advantage: instead of writing hundreds of lines of webgl code to build anything interesting you can use built-in helper functions to do it a lot easier and faster. see the building up a basic demo with three.js subpage for the step-by-step process of creating the demo. other tools ...
Plug-in Development Overview - Gecko Plugin API Reference
has been created with the language set to "us english" and the character set to "windows multilingual" in your development environment. the resource code for this language and character set combination is 040904e4. unix on unix, plug-ins are found according to the section how gecko finds plug-ins. to determine the mime types and file extensions that the plug-in handles, the browser loads each library and calls into the np_getmimedescription entry point. this exported c function should return a string containing the type, extension list, and type description separated by colons. each mime types should be separated by semicolons. for example: image/xbm:xbm:x bitmap or for 2 mime types: image/xbm:xbm:x bitmap;image/png:png:portable network graphics. this information will then appear in the navig...
...he cross-browser npruntime api should be used instead. see the scripting plugins section of this reference for the details. building plug-ins once you have added the special code and additional files to make your plug-in scriptable as described in the previous section, the build process is quite straightforward. in addition to the dll that goes in the plugins folder, you must also place a type library and an extra header file in the appropriate places in your application directory. this section describes those extra scriptability steps in more detail. building, platforms, and compilers the header files and some basic examples for npapi plugins are found in the npapi-sdk project (google code). installing plug-ins plug-ins should not be installed into the firefox directory. the plug-in insta...
... reg_sz "the plugin author/vendor" version: reg_sz "0.5.whatever plugin version string" hklm/software/mozillaplugins/plugin-identifier/mimetypes add a sub-key for each mime type the plugin supports, with no values install to known locations on linux and mac on linux and mac, plug-ins are installed to well-known locations: linux: /usr/lib/mozilla/plugins or /usr/lib64/mozilla/plugins mac: /library/internet plug-ins or ~/library/internet plug-ins ...
What is the difference between webpage, website, web server, and search engine? - Learn web development
a website on the internet. search engine a web service that helps you find other web pages, such as google, bing, yahoo, or duckduckgo. search engines are normally accessed through a web browser (e.g. you can perform search engine searches directly in the address bar of firefox, chrome, etc.) or through a web page (e.g. bing.com or duckduckgo.com). let's look at a simple analogy — a public library. this is what you would generally do when visiting a library: find a search index and look for the title of the book you want. make a note of the catalog number of the book. go to the particular section containing the book, find the right catalog number, and get the book. let's compare the library with a web server: the library is like a web server. it has several sections, which is sim...
...each section is like a unique website (two sections do not contain same books). the books in each section are like webpages. ...
...e website (two sections do not contain same books). the books in each section are like webpages. one website may have several webpages, e.g., the science section (the website) will have books on heat, sound, thermodynamics, statics, etc. (the webpages). webpages can each be found at a unique location (url). the search index is like the search engine. each book has its own unique location in the library (two books cannot be kept at the same place) which is specified by the catalog number. active learning there is no active learning available yet. deeper dive so, let's dig deeper into how those four terms are related and why they are sometimes confused with each other. web page a web page is a simple document displayable by a browser. such documents are written in the html language (which ...
Function return values - Learn web development
would actually be run as if it were this: ctx.arc(500, 200, 35, 0, 2 * math.pi); the function calls on the line are run first, and their return values substituted for the function calls, before the line itself is then executed. active learning: our own return value function let's have a go at writing our own functions featuring return values. first of all, make a local copy of the function-library.html file from github. this is a simple html page containing a text <input> field and a paragraph. there's also a <script> element, in which we have stored a reference to both html elements in two variables. this little page will allow you to enter a number into the text box, and display different numbers related to it in the paragraph below. let's add some useful functions to this <script> elem...
... calculate the required values. save your code, load it in a browser, and try it out. note: if you have trouble getting the example to work, feel free to check your code against the finished version on github (see it running live also), or ask us for help. now it's your turn! at this point, we'd like you to have a go at writing out a couple of functions of your own and adding them to the library. how about the square or cube root of the number? or the circumference of a circle with a given radius? some extra function related tips: look at another example of writing error handling into functions. it is generally a good idea to check that any necessary parameters are validated, and that any optional parameters have some kind of default value provided. this way, your program will be les...
... of a circle with a given radius? some extra function related tips: look at another example of writing error handling into functions. it is generally a good idea to check that any necessary parameters are validated, and that any optional parameters have some kind of default value provided. this way, your program will be less likely to throw errors. think about the idea of creating a function library. as you go further into your programming career, you'll start doing the same kinds of things over and over again. it is a good idea to create your own library of utility functions to do these sorts of things. you can copy them over to new code, or even just apply it to html pages wherever you need it. test your skills! you've reached the end of this article, but can you remember the most impor...
Third-party APIs - Learn web development
context(); ... const audioelement = document.queryselector('audio'); ... const audiosource = audioctx.createmediaelementsource(audioelement); // etc. third party apis, on the other hand, are located on third party servers. to access them from javascript you first need to connect to the api functionality and make it available on your page. this typically involves first linking to a javascript library available on the server via a <script> element, as seen in our mapquest example: <script src="https://api.mqcdn.com/sdk/mapquest-js/v1.3.2/mapquest.js"></script> <link type="text/css" rel="stylesheet" href="https://api.mqcdn.com/sdk/mapquest-js/v1.3.2/mapquest.css"/> you can then start using the objects available in that library. for example: let map = l.mapquest.map('map', { center: [53.480...
...as acceptable for a basic tutorial. we wanted to show that there are other alternatives available. a restful api — nytimes now let's look at another api example — the new york times api. this api allows you to retrieve new york times news story information and display it on your site. this type of api is known as a restful api — instead of getting data using the features of a javascript library like we did with mapquest, we get data by making http requests to specific urls, with data like search terms and other properties encoded in the url (often as url parameters). this is a common pattern you'll encounter with apis. an approach for using third-party apis below we'll take you through an exercise to show you how to use the nytimes api, which also provides a more general set of steps ...
...me player api to display the returned video examples inside iframe video players so you can watch them. this example is interesting because it shows two related third-party apis being used together to build an app. the first one is a restful api, while the second one works more like mapquest (with api-specific methods, etc.). it is worth noting however that both of the apis require a javascript library to be applied to the page. the restful api has functions available to handle making the http requests and returning the results. we are not going to say too much more about this example in the article — the source code has detailed comments inserted inside it to explain how it works. to get it running, you'll need to: get an api key from google cloud. find the string enter-api-key-here ...
Getting started with React - Learn web development
nd xml). familiarity with both html and javascript will help you to learn jsx, and better identify whether bugs in your application are related to javascript or to the more specific domain of react. objective: to set up a local react development environment, create a start app, and understand the basics of how it works hello react as its official tagline states, react is a library for building user interfaces. react is not a framework – it's not even exclusive to the web. it's used with other libraries to render to certain environments. for instance, react native can be used to build mobile applications; react 360 can be used to build virtual reality applications; and there are other possibilities besides. to build for the web, developers use react in tandem with reactd...
...t does not enforce strict rules around code conventions or file organization. this allows teams to set conventions that work best for them, and to adopt react in any way they would like to. react can handle a single button, a few pieces of an interface, or an app's entire user interface. while react can be used for small pieces of an interface, it's not as easy to "drop into" an application as a library like jquery, or even a framework like vue — it is more approachable when you build your entire app with react. in addition, many of the developer-experience benefits of a react app, such as writing interfaces with jsx, require a compilation process. adding a compiler like babel to a website makes the code on it run slowly, so developers often set up such tooling with a build step. react arguab...
...he app component in the middle, and an export statement at the bottom. most react components follow this pattern. import statements the import statements at the top of the file allow app.js to use code that has been defined elsewhere. let's look at these statements more closely. import react from 'react'; import logo from './logo.svg'; import './app.css'; the first statement imports the react library itself. because react turns the jsx we write into react.createelement(), all react components must import the react module. if you skip this step, your application will produce an error. the second statement imports a logo from './logo.svg'. note the use of ./ at the beginning of the path, and the .svg extension at the end — these tell us that the file is local and that it is not a javascript ...
Getting started with Vue - Learn web development
pm installed. objective: to setup a local vue development environment, create a starter app, and understand the basics of how it works. a clearer vue vue is a modern javascript framework that provides useful facilities for progressive enhancement — unlike many other frameworks, you can use vue to enhance existing html. this lets you use vue as a drop-in replacement for a library like jquery. that being said, you can also use vue to write entire single page applications (spas). this allows you to create markup managed entirely by vue, which can improve developer experience and performance when dealing with complex applications. it also allows you to take advantage of libraries for client-side routing and state management when you need to. additionally, vue takes a "middl...
...it also allows you to take advantage of libraries for client-side routing and state management when you need to. additionally, vue takes a "middle ground" approach to tooling like client-side routing and state management. while the vue core team maintains suggested libraries for these functions, they are not directly bundled into vue. this allows you to select a different routing/state management library if they better fit your application. in addition to allowing you to progressively integrate vue into your applications, vue also provides a progressive approach to writing markup. like most frameworks, vue lets you create reusable blocks of markup via components. most of the time, vue components are written using a special html template syntax. when you need more control than the html syntax all...
...mparison between vue and many of the other frameworks, see vue docs: comparison with other frameworks. installation to use vue in an existing site, you can drop one of the following <script> elements onto a page. this allows you to start using vue on existing sites, which is why vue prides itself on being a progressive framework. this is a great option when migrating an existing project using a library like jquery to vue. with this method, you can use a lot of the core features of vue, such as the attributes, custom components, and data-management. development script (unoptimized, but includes console warnings. great for development <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> production script (optimized version, minimal console warnings. it is recommende...
Handling common HTML and CSS problems - Learn web development
some information. note: of course, this may not be a great solution for your project's needs — the difference in visual presentation is not great, plus it is harder to guarantee the data will be entered in the format you want it in. for cross browser forms, it is probably better to rely on simple form elements, or selectively use advanced form elements only in supporting browsers, or using a library that provides decent cross browser form widgets, such as jquery ui or bootstrap datepicker. css fallback behaviour css is arguably better at fallbacks than html. if a browser encounters a declaration or rule it doesn't understand, it just skips it completely without applying it or throwing an error. this might be frustrating for you and your users if such a mistake slips through to production ...
...tter off using a general descendant selector instead of a child selector). however, another issue that appears in versions of ie older than 9 is that none of the newer selectors (mainly pseudo-classes and pseudo-elements like :nth-of-type, :not, ::selection, etc.) work. if you want to use these in your css and you need to support older ie versions, a good move is to use keith clark's selectivizr library — this is a small javascript library that works on top of an existing javascript library like jquery or mootools. to try this example, make a local copy of selectivizr-example-start.html. if you look at this running live, you'll see that it contains two paragraphs, one of which is styled. we've selected the paragraph with p:first-child, which won't work in old versions of ie. now download m...
...nts both the -webkit- version and the non-prefixed version, it will first apply the -webkit- version, then override it with the non-prefixed version. you want it to happen this way round, not the other way round. of course, doing this for lots of different css rules can get really tedious. it is better to use an automation tool to do it for you. and such tools exist: the prefix-free javascript library can be attached to a page, and will automatically detect what capabilities are possessed by browsers viewing the page and add prefixes as appropriate. it is really easy and convenient to use, although it does have some downsides (see the link above for details), and it is arguable that parsing every stylesheet in your site and add prefixes at run time can be a drain on the computer's processing p...
NSPR Contributor Guide
. bugfixes use bugzilla to track bugs. document the bug or use an existing report. be verbose in describing what you are doing and why. include your changes as diffs in an attachment to the bugzilla report. use a coding style consistent with the source file you are changing. new features for purposes of this paper, a "new feature" is defined as some api addition that goes into the core nspr library, for example: libnspr4.dll nspr is mostly complete. new apis are driven mostly by the os vendors as they add new features. should you decide that there's something that nspr does not cover that should be covered, let's talk. your proposed api should encapsulate a relatively low level capability as would be found in a system call or libc. your new feature must be implemented on all platforms suppo...
...e think they should be. the following are some general guidelines to use when implementing new features: don't export global variables your code must be thread safe you must provide test cases that test all apis you are adding. see: [#testcases test cases] new libraries all the guidelines applicable to [#newfeatures new features] applies to new libraries. for purposes of this paper, a "new library" is defined as a libary under the mozilla/nsprpub/lib directory tree and built as a separate library. these libraries exist, for the most part, as "legacy" code from nspr 1.0. [note that the current nspr module owners do not now nor never have been involved with nspr 1.0.]. such is life. that said: there are some libraries that implement functions intended for use with applications using nspr, su...
...om nspr 1.0. [note that the current nspr module owners do not now nor never have been involved with nspr 1.0.]. such is life. that said: there are some libraries that implement functions intended for use with applications using nspr, such as ...nsprpub/lib/libc/plgetopt.*. generally useful platform abstractions you agree to sustain, bug fix may rely on the nspr api may not rely on any other library api new platform ports all nspr api items must be implemented platform specific headers in pr/include/md/_platformname.[h!cfg] platform specific code in pr/src/md/platform/*.c make rules in config/_platform.mk documentation the files for nspr's documentation are maintained using a proprietary word processing system [don't ask]. document your work as described in [#newfeatures new featur...
Optimizing Applications For NSPR
bit file offset behavior. on windows 3.1, when nspr detects a value in a 64 bit file offset greater than 32bit significance, it terminates with an assert. the general rules of 16 bit large model memory restrictions apply to applications using nspr on windows 3.1. the nspr process creation api functions return an error when invoked on windows 3.1. functions called in an application by a shared library require an additional function prolog. the prolog is presented in the macro <tt>pr_callback</tt>. for any function made available to any shared library (most likely passed in as a function pointer), that function must have the <tt>pr_callback</tt> qualifier. nspr functions are normally declared <tt>__cdecl</tt>. these declarations are hidden in the <tt>pr_extern()</tt> declarations in nspr's hea...
.... do not depend on file i/o being synchronous. command line applications using the libc printf() and related apis behave funny on windows 3.1. read the fine print in the windows sdk for the grizzly details. watch out for printn overflow on win16. make sure all possible values of your printn variables are within 2^16. win-95 the win-95 version of nspr should really be labeled win-32. the same library will work on either win-nt or win-95. win-95 nspr uses native threads as nspr threads. generally speaking, the native threads (on nt or '95) are quite functional. however, having lots of them (100s or even 1000s) is unrealistic. <tt>pr_interrupt()</tt> is not implemented. win-nt the win-nt port of nspr takes advantage of some of the features of nt that are not available in win-95, such as f...
...pr_connect()</tt>. irix the irix (classic) implementation has a known race condition in creating new threads. if the spawned thread establishes and exits before the parent thread is resumed, the parent will be left with an invalid pointer to the child. the problem has a solution that will be available soon. digital unix digital unix (aka, osf1) requires the latest patches for the pthreads library. the changes are not evident until one tries to do thread suspension (<tt>pr_suspendall()</tt>) which is in preparation for garbage collection. digital unix is the main platform used for nspr's prototype use of ipv6. there are some conflicts between the patches needed to use ipv6 and those needed for pthreads. the ipv6 kit needs to be applied on a baseline configuration of digital unix v4.0b. ...
Hash Tables
a hash table lookup may change the internal organization of the hash table (to speed up future lookups). ...
... a hash table lookup may change the internal organization of the hash table (to speed up future lookups). ...
... a hash table lookup may change the internal organization of the hash table (to speed up future lookups). ...
PR_CALLBACK
normally such functions are passed by reference (pointer to function). ...
...normally such functions are passed by reference (pointer to function). ...
...normally such functions are passed by reference (pointer to function). ...
NSS 3.20 release notes
network security services (nss) 3.20, which is a minor release. distribution information the hg tag is nss_3_20_rtm. nss 3.20 requires nspr 4.10.8 or newer. nss 3.20 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_20_rtm/src/ new in nss 3.20 new functionality the tls library has been extended to support dhe ciphersuites in server applications. new functions in ssl.h ssl_dhegroupprefset - configure the set of allowed/enabled dhe group parameters that can be used by nss for a server socket. ssl_enableweakdheprimegroup - enable the use of weak dhe group parameters that are smaller than default minimum size of the library. new types in sslt.h ...
...they can be enabled with the new socket option ssl_enable_server_dhe and the ssl_optionset or the ssl_optionsetdefault api. ...
...n nss that can be used with function ssl_dhegroupprefset new macros in ssl.h ssl_enable_server_dhe - a socket option user to enable or disable dhe ciphersuites for a server socket notable changes in nss 3.20 the tls library has been extended to support dhe ciphersuites in server applications. for backward compatibility reasons, the server side implementation of the tls library keeps all dhe ciphersuites disabled by default. they can be enabled with the new socket option ssl_enable_server_dhe and the ssl_optionset or the ssl_optionsetdefault api. the server side implementation of the tls does not support session tickets while using a dhe ciphersuite (see bug 1174677). support for the following ciphersuites has been added: tls_dhe_dss_with_aes_128_gcm_sha256 ...
Utilities for nss samples
it shows the following: read der from a file. compile file size. get seed from a noise gile. generate random numbers. get a module password. extract the password from a text file. print data as hexadecimal. util.h /* this source code form is subject to the terms of the mozilla public * license, v. 2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. ...
...not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. */ #ifndef _util_h #define _util_h #include <prlog.h> #include <termios.h> #include <base64.h> #include <unistd.h> #include <sys/stat.h> #include "util.h" #include <prprf.h> #include <prerror.h> #include <nss.h> #include <pk11func.h> /* * these utility functions are adapted from those found in * the sectool library used by the nss security tools and * other nss test applications. */ typedef struct { enum { pw_none = 0, /* no password */ pw_fromfile = 1, /* password stored in a file */ pw_plaintext = 2 /* plain-text password passed in buffer */ /* pw_external = 3 */ } source; char *data; /* depending on source this can be the actual * passw...
...adderfromfile(secitem *der, const char *infilename, prbool ascii); #endif /* _util_h */ util.c /* this source code form is subject to the terms of the mozilla public * license, v. 2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. */ #include "util.h" /* * these utility functions are adapted from those found in * the sectool library used by the nss security tools and * other nss test applications. */ /* * newline */ static void newline(prfiledesc* out) { pr_fprintf(out, "\n"); } /* * printasascii */ void printasascii(prfiledesc* out, const unsigned char *data, unsigned int len) { char *b64data = null; b64data = btoa_datatoascii(data, len); pr_fprintf(out, "%s", b64data); pr_fprintf(out, "\n"); ...
NSPR functions
nss uses nspr internally as the porting layer. however, a small number of nspr functions are required for using the certificate verification and ssl functions in nss. these nspr functions are listed in this section. nspr initialization and shutdown nspr is automatically initialized by the first nspr function called by the application. call pr_cleanup to shut down nspr and clean up its resources. pr_cleanup error reporting nss uses nspr's thread-specific error code to report errors. call pr_geterror to get the error code of the last failed nss or nspr function. call pr_seterror to set the error code, which can be retrieved with pr_geterror later. ...
...s) take a printervaltime timeout parameter. printervaltime has an abstract, platform-dependent time unit. call pr_secondstointerval or pr_millisecondstointerval to convert a time interval in seconds or milliseconds to printervaltime. pr_secondstointerval pr_millisecondstointerval nspr i/o layering nspr file descriptors can be layered, corresponding to the layers in the network stack. the ssl library in nss implements the ssl protocol as an nspr i/o layer, which sits on top of another nspr i/o layer that represents tcp. you can implement an nspr i/o layer that wraps your own tcp socket code. the following nspr functions allow you to create your own nspr i/o layer and manipulate it. pr_getuniqueidentity pr_createiolayerstub pr_getdefaultiomethods pr_getidentitieslayer pr_getlayersidentity pr...
... pr_getlayersidentity pr_pushiolayer pr_popiolayer wrapping a native file descriptor if your current tcp socket code uses the standard bsd socket api, a lighter-weight method than creating your own nspr i/o layer is to simply import a native file descriptor into nspr. this method is convenient and works for most applications. pr_importtcpsocket socket i/o functions as mentioned above, the ssl library in nss implements the ssl protocol as an nspr i/o layer. users call nspr socket i/o functions to read from, write to, and shut down an ssl connection, and to close an nspr file descriptor. pr_read pr_write pr_recv pr_send pr_getsocketoption pr_setsocketoption pr_shutdown pr_close ...
NSS environment variables
ies during shutdown. necessary on some platforms to get correct function names when using leak reporting software. 3.11.8 nss_enable_audit boolean (1 to enable) enable auditing of activities of the nss cryptographic module in fips mode. audit data 3.11.2 nss_enable_pkix_verify boolean (any non-empty value to enable) use libpkix, rather than the old cert library, to verify certificates. 3.12 nss_fips string ("fips","true","on","1") will start nss in fips mode. 3.12.5 nss_hash_alg_support string specifies agorithms allowed to be used in certain applications, such as in signatures on certificates and crls. see documentation at this link. 3.12.3 nss_output_file string (filename) output file path ...
...optimized builds for logging ssl/tls key material to a logfile if the sslkeylogfile environment variable. as of nss 3.24 this is disabled by default. 3.24 nss_build_continue_on_error boolean (1 to enable) continue building nss source directories when a build error occurs. 3.12.4 nss_use_system_sqlite boolean (1 to enable) use the system installed sqlite library instead of the in-tree version. 3.12.6 nss_disable_ecc (deprecated) boolean (1 to disable) disable elliptic curve cryptography features. as of nss 3.16, ecc features are enabled by default. as of nss 3.33 this variable has no effect. 3.16 nss_enable_ecc (deprecated) boolean (1 to enable) enable building of code that uses elliptic curve cryptogr...
... on which the build is performed. values understood: win95 before 3.0 use_64 boolean (1 to enable) on platforms that has separate 32-bit and 64-bit abis, nss builds for the 32-bit abi by default. this tells nss to build for the 64-bit abi. before 3.0 use_debug_rtl boolean (1 to enable) on windows, msvc has options to build with a normal run time library or a debug run time library. this tells nss to build with the debug run time library. before 3.0 use_pthreads boolean (1 to enable) on platforms where posix threads are available, but are not the os'es preferred threads library, this tells nss and nspr to build using pthreads. before 3.0 nss_no_pkcs11_bypass string (1 to enable) disables at compile-time...
Rhino scopes and contexts
scope. uses of standard objects like function, string, or regexp will find the definitions in the shared scope. multiple instance scopes can be defined and have their own variables for scripts yet share the definitions in the shared scope. these multiple instance scopes can be used concurrently. sealed shared scopes the ecmascript standard defines that scripts can add properties to all standard library objects and in many cases it is also possible to change or delete their properties as well. such behavior may not be suitable with shared scopes since if a script by mistake adds a property to a library object from the shared scope, that object would not be garbage collected until there are no active references to the shared scope potentially leading to memory leaks. in addition if a script alter...
...such bugs are hard to debug and to remove a possibility for them to occur one can seal the shared scope and all its objects. ...
...ard to debug and to remove a possibility for them to occur one can seal the shared scope and all its objects. a notion of a sealed object is a javascript extension supported by rhino and it means that properties can not be added/deleted to the object and the existing object properties can not be changed. any attempt to modify sealed object throws an exception. to seal all objects in the standard library passtrue for the sealed argument when calling context.initstandardobjects(scriptableobject, boolean): scriptableobject sealedsharedscope = cx.initstandardobjects(null, true); this seals only all standard library objects, it does not seal the shared scope itself thus after callinginitstandardobjects, sealedsharedscope can be farther populated with application-specific objects and functions. the...
FOSS
feel free to add your own spidermonkey-based open source projects (and if necessary add categories)! wrappers / bindings c++ cocos2d-js - cocos2d-js is a cross-platform game engine which embeds spidermonkey, providing the same api for both web and native platforms. getting started here. ...
...includes a js shell that allows you to use cpan modules from javascript. python http://pypi.python.org/pypi/python-spidermonkey wxwidgets gluescript (fo...
...signals, ffi, and more. ...
Index
cts. the finalizer's job is to clean up any resources allocated by the instance which wouldn't normally be cleaned up by the garbage collector (private data stored in the object by the application, file handles, etc.) 108 jsfreeop jsapi reference, reference, référence(2), spidermonkey various finalization api takes not jscontext * but rather either jsfreeop structure or its library-private counterpart freeop. these structures wrap parameters that are passed to the finalizers removing most of explicit dependencies on jscontext in the finalization code. 109 jsfunction api, guide, jsapi, needscontent, spidermonkey jsfunction is a type in the jsapi. the apis js_newfunction, js_definefunction, js_compilefunction, and their unicode equivalents return values o...
... the level of additional garbage collection to perform for a runtime, for the purpose of finding or reproducing bugs. 461 js_setglobalobject jsapi reference, obsolete, spidermonkey this function is obsolete; see also js_getglobalobject. 462 js_seticumemoryfunctions sets the memory allocation and deallocation functions used by the icu internationalization library. 463 js_setinterruptcallback jsapi_reference, reference, spidermonkey these functions allow setting an interrupt callback that will be called from the js thread some time after any thread triggered the callback using js_requestinterruptcallback. to schedule the gc and for other activities the engine internally triggers interrupt callbacks. the embedding should thus not rely ...
...t, needsupdate, spidermonkey at heart, spidermonkey is a fast interpreter that runs an untyped bytecode and operates on values of type js::value—type-tagged values that represent the full range of javascript values. in addition to the interpreter, spidermonkey contains a just-in-time (jit) compiler, a garbage collector, code implementing the basic behavior of javascript values, a standard library implementing ecma 262-5.1 §15 with various extensions, and a few public apis. 528 64-bit compatibility spidermonkey the following types or typedefs are always 64-bit on 64-bit platforms, and 32-bit on 32-bit platforms: 529 bytecode descriptions spidermonkey this document is automatically generated from opcodes.h by make_opcode_doc.py. 530 byte...
Signing Mozilla apps for Mac OS X
e signing certificate you want to sign the application with your-signing-identity is the name of your certificate. --keychain /path/to/keychain lets you specify which keychain contains the signing certificate specified by your-signing-identity, rather than allowing the codesign to search the keychain list. the path specified must be a full path; it's usually something similar to /users/username/library/keychains/keychain-name.keychain. --resource-rules /path/to/coderesources specifies a file to use when generating the rules to be applied to the code signing. when you're signing mozilla applications with v1 signatures, you'll need to specify a custom coderesources file here. -f forces codesign to overwrite an existing signature on the application. -v increases the verbosity of the codesign...
...id. you can find it by running this command in the terminal: openssl x509 -text -noout -inform der -in devloperid_application.cer | grep subject putting it all together, you'll wind up using a command similar to the one below to sign your app. you'll of course need to change the signing id, keychain, bundle path, and requirements. ...
... and certificate leaf[field.1.2.840.113635.100.6.1.9] ) or (anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] and certificate leaf[field.1.2.840.113635.100.6.1.13] and certificate leaf[subject.ou] = "43aq936h96"))' \ application.app or if you're using v2 signing, the command might look like this: codesign -s mac-testing -fv --deep \ --keychain /users/user/library/keychains/mykeychain.keychain \ --requirements '=designated => ( (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9] ) or (anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] and certificate leaf[field.1.2.840.113635.100.6.1.13] and certificate leaf[subject.ou] = "43aq936h96"))' \ application.app depending on your keychain preferences,...
Embedded Dialog API
ed for updates. however, it's nearly accurate to claim that the majority of all dialogs and alerts posed by gecko do reside in a single generic component, nsipromptservice (nsipromptservice). an mfc example is implemented in promptservice.cpp. a powerplant example is implemented in promptservice.cpp. ...
...ice.cpp. a powerplant example is implemented in promptservice.cpp. (testgtkembed doesn't override promptservice; it uses the default dialogs.) both are source for a library set up as a mozilla component and factory. (note to self: is there decent documentation on writing factories or components? i can't find any.) both contain implementations of nsipromptservice as native dialogs. the replacement library should be installed during application initialization. the default dialog-posing library is a component (promptservice for instance is part of the embedding component), registered as a component during gecko initialization (by ns_initembedding). (line number accurate in version 1.30). after initializing embedding, an application can override a default factory by registering its replacement. a pow...
... a default factory by registering its replacement. a powerplant example can be found at cbrowserapp::overridecomponents (line number accurate in version 1.24) and an mfc example at cmfcembedapp::overridecomponents (line number accurate in version 1.20). the powerplant example is more is more straightforward.its promptservice is implemented directly in the application executable, not as a separate library. this is perfectly workable, as the example illustrates. the mfc example implements its promptservice in a separate dll, and overrides the default promptservice only if it is able to load the override dll at application startup. its promptservice dialogs can be switched between default and overridden by moving the override dll into or out of the library search path. other sets of dialogs and aler...
Using XPCOM Utilities to Make Things Easier
t easier. though they overlap somewhat (e.g., high-level macros expand to other macros), they fall into the following general categories. generic xpcom module macros the work in the previous chapter was useful in setting up the generic component code. but there are only a few places in that code that are unique to the weblock component, and it was a lot of typing. to write a different component library, you could copy the listing at the end of the chapter, change very little, and paste it into a new project. to avoid these kinds of redundancies, to regulate the way generic code is written, and to save typing, xpcom providesgeneric module macros that expand into the module code you've already seen. since these macros expand into "generic" implementations, they may not offer as much flexibility ...
...backs, but all the macros follow the same general pattern. all of these macros work on an array of structures represented by the components parameter. each structure describes a cid that is to be registered with xpcom. the first parameter for each of these macros is an arbitrary string that names the module. in a debugging environment, this string will be printed to the screen when the component library is loaded or unloaded. you should pick a name that makes sense and helps you keep track of things. the four required parts[other-parts] of the structure contain the following information: a human readable class name the class id (cid) the contract id (an optional but recommended argument) a constructor for the given object static const nsmodulecomponentinfo components[] = { { "pretty cl...
...of the xpcom interfaces we'll look at in the following chapters. using strings explaining how all the string classes work is outside the scope of this book, but we can show you how to use strings in the weblock component. the first thing to note is that the string classes themselves are not frozen, which means that you should not link against them when you can avoid it. linking the full string library (.lib or .a) into a component may raise its footprint by more than 100k (on windows), which in many cases is an unacceptable gain (see the xpcom string guide). for weblock, where the string classes need to be only wrappers around already existing string data, trading advanced functionality for a much smaller footprint is the right way to go. the weblock string classes don't need to append, concat...
Mozilla internal string guide
the headers and implementation are in the xpcom/string directory. ...
...pendentsubstring. nsprintfcstring- derived from nscstring, this string behaves like an nsautocstring. the constructor takes parameters which allows it to construct a 8-bit string from a printf-style format string and parameter list. there are also a number of concrete classes that are created as a side-effect of helper routines, etc. you should avoid direct use of these classes. let the string library create the class for you. nssubstringtuple - created via string concatenation nsdependentsubstring - created through substring nspromiseflatstring - created through promiseflatstring() nsliteral[c]string - created through the ""_ns and u""_ns user-defined literals of course, there are times when it is necessary to reference these string classes in your code, but as a general rule they sho...
...ing such a large n as to overflow the run-time stack). there is no need to include room for the null terminator: it is the job of the string class. note: calling setcapacity() does not give you permission to use the pointer obtained from beginwriting() to write past the current length (as returned by length()) of the string. please use either bulkwrite() or setlength() instead. idl the string library is also available through idl. by declaring attributes and methods using the specially defined idl types, string classes are used as parameters to the corresponding methods. idl string types the c++ signatures follow the abstract-type convention described above, such that all method parameters are based on the abstract classes. the following table describes the purpose of each string type in id...
Using the Gecko SDK
an xpcom component will be compatible with future versions of mozilla if it only makes use of frozen gecko apis. a frozen gecko api is one that is included in the gecko and marked frozen with the text <tt>@status frozen</tt> (with nspr as the exception to the rule). the frozen gecko api consists of a set of component interfaces (c++ vtables) and <tt>extern "c"</tt> symbols exported from the xpcom library and the nspr libraries. the abi of the component interfaces depends on the c++ abi of the host compiler (i.e., the vtable format and calling conventions of the virtual methods may vary from compiler to compiler). the gecko abi is therefore compiler sensitive. (<tt>about:buildconfig</tt> can be loaded in mozilla to reveal details about the compiler that was used.) for the remainder of this guide, ...
...his guide are welcome.) a "frozen" interface or function is guaranteed to be supported by future versions of same major version of the platform. the sdk contains headers for all of the frozen interfaces and functions, and it also contains headers for classes and functions defined in the glue libraries. when those classes or functions are used, the component must link with the corresponding static library. every frozen interface or function will be labeled as such in the idl or header file with "@status frozen". (note: nspr is the one exception to this rule. all nspr functions are frozen by default and are not marked as such in the respective header files.) the glue library exists to make common tasks easier. for example, the nscomptr class is defined in the xpcom glue library. if your component d...
...atus frozen". (note: nspr is the one exception to this rule. all nspr functions are frozen by default and are not marked as such in the respective header files.) the glue library exists to make common tasks easier. for example, the nscomptr class is defined in the xpcom glue library. if your component does not use any of the glue classes or functions, then you do not need to link against the glue library. work in progress... linking (link line, version script to only expose nsgetmodule, etc.) ...
XPCOM tasks
rest only. the role of xpcom the xpcom module roughly parallels the c/c++ standard libraries. it overlaps them significantly, but goes beyond them in capabilities. xpcom sits above the standard libraries. its role is to extend them with facilities tailored to xpcom development in general, and specifically the needs of mozilla. like the standard libraries, xpcom must be a fairly self-contained library, so as not to encumber clients with any unnecessary external dependencies. changes to the build hierarchy there are things in xpcom that don't belong there. there is likely to be code outside of xpcom that should be in it. there is code above xpcom that should be below it. p3 i/o functionality (except for the filespec facility) probably doesn't belong in xpcom; perhaps it should be moved to ...
... a first step is moving all qi implementations to the table-like macros already in place (and some slight modifications to those macros). see bug 23737 work is progressing on this. see in particular, the new ns_interface_map_... macros in "nsisupportsutils.h". p1 we need to use ns_get_iid instead of ns_define_iid. see bug 25886. work is progressing on this. ...
...this is probably best done with a c wrapper around an xpcom enumerator. p2 do we still require our own version of quicksort? and if so, can we narrow it to only those platforms that need it? p3 we need to check for aggregation in createinstance(). see bug 16763 p3 improve the performance of the registry. ...
Using Objective-C from js-ctypes
ons in addition to the above code, we need to declare function and types. types types can be readily declared. bool is defined in /usr/include/objc/objc.h. let id = ctypes.structtype("objc_object").ptr; let sel = ctypes.structtype("objc_selector").ptr; let bool = ctypes.signed_char; functions all functions in our example are exported by /usr/lib/libobjc.dylib. let lib = ctypes.open(ctypes.libraryname("objc")); function definition is the more tricky part. in this example, objc_msgsend is used in 3 ways. we need to declare three different functiontype cdatas: returns id or compatible type. returns bool. returns nothing. let objc_msgsend_id = lib.declare("objc_msgsend", ctypes.default_abi, id, id, sel, "..."); let objc_msgsend_bool = lib.declare("ob...
...espond until the speaking is done. if this code were to be used in a production add-on, then to avoid firefox locking up, run this code from a chromeworker. ...
...n learn more about blocks. to create a block with js-ctypes, use the function: function createblock(afunctypeptr) { /** * creates a c block instance from a js function. * blocks are regular objective-c objects in obj-c, and can be sent messages; * thus block instances need are creted using the core.wrapid() function. */ // apple docs :: working with blocks - https://developer.apple.com/library/ios/documentation/cocoa/conceptual/programmingwithobjectivec/workingwithblocks/workingwithblocks.html var _nsconcreteglobalblock = ctypes.open(ctypes.libraryname('objc')).declare('_nsconcreteglobalblock', ctypes.voidptr_t); // //github.com/realityripple/uxp/blob/master/js/src/ctypes/library.cpp?offset=0#271 /** * the "block descriptor" is a static singleton struct. probably used in more ...
Working with data
to a ctypes.uintptr_t, for which the value property returns a ctypes.uint64. calling tostring() on that returns the pointer as a base 10 integer. using arrays of pointers if you need to work with c functions that accept arrays of pointers as inputs, you can construct an array of pointers like this: var ptrarraytype = ctypes.char.ptr.array(5); var myarray = ptrarraytype(); var somecfunction = library.declare("somecfunction", ctypes.default_abi, ctypes.void_t, ctypes.char.ptr.array() /*same as ctypes.char.ptr.ptr*/); somecfunction(myarray); line 1 declares a new array type, capable of containing 5 arrays of pointers to c characters. this might be an array of strings, for example. the next line instantiates an object of that type, creating a new array. each pointer in the array is initialize...
...g a new array. each pointer in the array is initialized to null. line 4 declares the c function that accepts the array as an input, and the last line calls that function. ...
...pe = ctypes.char.array(5); var myarray = myarraytype(); var somecfunction = library.declare("somecfunction", ctypes.default_abi, ctypes.void_t, ctypes.char.array() /*same as ctypes.char.ptr*/); somecfunction(myarray); second example: var mystruct = ctypes.structtype('foo', [{bar: ctypes.bool}]); var mystructarraytype = mystruct.array(5); var myarray = mystructarraytype(); var somecfunction = library.declare("somecfunction", ctypes.default_abi, ctypes.void_t, mystruct.ptr); somecfunction(myarray); this shows how to pass a buffer containing 5 elements of mystruct, the elements in myarray are not pointers. 64-bit integers while most numeric types in js-ctypes are represented by standard javascript number objects, 64-bit integers cannot all be represented accurately by this type. for that re...
Plug-in Development Overview - Plugins
has been created with the language set to "us english" and the character set to "windows multilingual" in your development environment. the resource code for this language and character set combination is 040904e4. unix on unix, plug-ins are found according to the section how gecko finds plug-ins. to determine the mime types and file extensions that the plug-in handles, the browser loads each library and calls into the np_getmimedescription entry point. this exported c function should return a string containing the type, extension list, and type description separated by colons. each mime types should be separated by semicolons. for example: image/xbm:xbm:x bitmap or for 2 mime types: image/xbm:xbm:x bitmap;image/png:png:portable network graphics. this information will then appear in the navig...
...he cross-browser npruntime api should be used instead. see the scripting plugins section of this reference for the details. building plug-ins once you have added the special code and additional files to make your plug-in scriptable as described in the previous section, the build process is quite straightforward. in addition to the dll that goes in the plugins folder, you must also place a type library and an extra header file in the appropriate places in your application directory. this section describes those extra scriptability steps in more detail. building, platforms, and compilers the header files and some basic examples for npapi plugins are found in the npapi-sdk project (google code). installing plug-ins plug-ins should not be installed into the firefox directory. the plug-in insta...
... reg_sz "the plugin author/vendor" version: reg_sz "0.5.whatever plugin version string" hklm/software/mozillaplugins/plugin-identifier/mimetypes add a sub-key for each mime type the plugin supports, with no values install to known locations on linux and mac on linux and mac, plug-ins are installed to well-known locations: linux: /usr/lib/mozilla/plugins or /usr/lib64/mozilla/plugins mac: /library/internet plug-ins or ~/library/internet plug-ins ...
WebGL: 2D and 3D graphics for the web - Web APIs
Web › API › WebGL API
webgl does so by introducing an api that closely conforms to opengl es 2.0 that can be used in html5 <canvas> elements. this conformance makes it possible for the api to take advantage of hardware graphics acceleration provided by the user's device. support for webgl is present in firefox 4+, google chrome 9+, opera 12+, safari 5.1+, internet explorer 11+, and microsoft edge build 10240+; however, the user's device must also have hardware that supports these features. ...
...al with fundamentals of webgl. webgl playground an online tool for creating and sharing webgl projects. good for quick prototyping and experimenting. webgl academy an html/javascript editor with tutorials to learn basics of webgl programming. webgl stats a site with statistics about webgl capabilities in browsers on different platforms. libraries glmatrix is a javascript matrix and vector library for high-performance webgl apps. philogl is a webgl framework for data visualization, creative coding, and game development. pixi.js is a fast, open-source 2d webgl renderer. playcanvas is an open-source game engine. sylvester is an open-source library for manipulating vectors and matrices. not optimized for webgl but extremely robust. three.js is an open-source, fully featured 3d webgl libr...
...s a fast, open-source 2d webgl renderer. playcanvas is an open-source game engine. sylvester is an open-source library for manipulating vectors and matrices. not optimized for webgl but extremely robust. three.js is an open-source, fully featured 3d webgl library. phaser is a fast, free and fun open source framework for canvas and webgl powered browser games. redgl is an open-source 3d webgl library. vtk.js is a javascript library for scientific visualization in your browser. specifications specification status comment opengl es 3.0 standard opengl es 2.0 standard webgl 2.0 editor's draft builds on top of webgl 1. based on opengl es 3.0. webgl 1.0 recommendation initial definition. based on opengl es 2.0 ...
Performance fundamentals - Web Performance
and are less likely discarded, in the case of firefox os (see the note below). this in turn means they "start up" faster (since they are already running) and have better upp. specific coding tips for application performance the following practical tips will help improve one or more of the application performance factors discussed above. use css animations and transitions instead of using some library’s animate() function, which probably currently uses many badly performing technologies (window.settimeout() or top/left positioning, for example) use css animations. in many cases, you can actually use css transitions to get the job done. this works well because the browser is designed to optimize these effects and use the gpu to handle them smoothly with minimal impact on processor performance...
...even watch events fired during the animation process in order to handle other tasks that need to be performed at set points in the animation process. you can easily trigger these animations with the :hover, :focus, or :target, or by dynamically adding and removing classes on parent elements. if you want to create animations on the fly or modify them in javascript, james long has written a simple library for that called css-animations.js. use css transforms instead of tweaking absolute positioning and fiddling with all that math yourself, use the transform css property to adjust the position, scale, and so forth of your content. the reason is, once again, hardware acceleration. the browser can do these tasks on your gpu, letting the cpu handle other things. in addition, transforms give you cap...
...ility-aware web developers we love click events since they also support keyboard input. on mobile devices, these are too slow. you should use touchstart and touchend instead. the reason is that these don’t have a delay that makes the interaction with the app appear sluggish. if you test for touch support first, you don’t sacrifice accessibility, either. for example, the financial times uses a library called fastclick for that purpose, which is available for you to use. keep your interface simple one big performance issue we found in html5 apps was that moving lots of dom elements around makes everything sluggish — especially when they feature lots of gradients and drop shadows. it helps a lot to simplify your look-and-feel and move a proxy element around when you drag and drop. when, for...
Caching compiled WebAssembly modules - WebAssembly
around this. caching via indexeddb indexeddb is a transactional database system that allows you to store and retrieve structured data on the client-side. it is ideal for persisting assets locally for the saved state of an application, including text, blobs, and any other type of cloneable object. this includes compiled wasm modules (webassembly.module javascript objects). ...
...hat allows you to store and retrieve structured data on the client-side. it is ideal for persisting assets locally for the saved state of an application, including text, blobs, and any other type of cloneable object. this includes compiled wasm modules (webassembly.module javascript objects). setting up a caching library because indexeddb is a somewhat old-fashioned api, we wanted to provide a library function to speed up writing caching code, and make it work better along with today's more modern apis. in our wasm-utils.js library script, you'll find instantiatecachedurl() — this function fetches the wasm module at url with a version of dbversion, instantiates it with the given importobject, and returns a promise resolving to the finished wasm instance. additionally, it handles creating a ...
... database failed (for example due to permissions or quota), we fall back to simply fetching and compiling the module and don't try to store the results (since there is no database to store them into). errmsg => { console.log(errmsg); return webassembly.instantiatestreaming(fetch(url)).then(results => { return results.instance }); }); } caching a wasm module with the above library function defined, getting a wasm module instance and using its exported features (while handling caching in the background) is as simple as calling it with the following parameters: a cache version, which — as we explained above — you need to update when any wasm module is updated or moved to a different url. the url of the wasm module you want to instantiate. an import object, if requir...
Compiling from Rust to WebAssembly - WebAssembly
and npm installed. to get node.js and npm, go to the get npm! page and follow the instructions. when it comes to picking a version, choose any one you'd like; this tutorial isn't version-specific. building our webassembly npm package enough setup; let's create a new package in rust. navigate to wherever you keep your personal projects, and type this: $ cargo new --lib hello-wasm created library `hello-wasm` project this creates a new library in a subdirectory named hello-wasm with everything you need to get going: +-- cargo.toml +-- src +-- lib.rs first, we have cargo.toml; this is the file that we use to configure our build. if you've used gemfile from bundler or package.json from npm, this is likely to be familiar; cargo works in a similar manner to both of them. next, cargo h...
...explanation here, and gloss over some details; to learn more about rust, please check the free online book the rust programming language. using wasm-bindgen to communicate between rust and javascript the first part looks like this: use wasm_bindgen::prelude::*; libraries are called "crates" in rust. get it? cargo ships crates. the third line contains a use command, which imports code from a library into your code. in this case, we're importing everything in the wasm_bindgen::prelude module. we use these features in the next section. before we move on to the next section, we should talk a bit more about wasm-bindgen. wasm-pack uses wasm-bindgen, another tool, to provide a bridge between the types of javascript and rust. it allows javascript to call a rust api with a string, or a rust funct...
...ase, a format string, and a variable to put in it. the format string is the "hello, {}!" bit. it contains {}s, where variables will be interpolated. the variable we're passing is name, the argument to the function, so if we call greet("steve") we should see "hello, steve!". this is passed to alert(), so when we call this function we will see an alert box with "hello, steve!" in it. now that our library is written, let's build it. compiling our code to webassembly to compile our code correctly, we first need to configure it with cargo.toml. open this file, and change its contents to look like this: [package] name = "hello-wasm" version = "0.1.0" authors = ["your name <you@example.com>"] description = "a sample project with wasm-pack" license = "mit/apache-2.0" repository = "https://github.com...
Content Scripts - Archive of obsolete content
le: [data.url("jquery.min.js"), data.url("my-content-script.js")] }); if you do this, the scripts can interact directly with each other, just like scripts loaded by the same web page. you can also use contentscript and contentscriptfile together. if you do this, scripts specified using contentscriptfile are loaded before those specified using contentscript. ...
...; console.log: my-addon: null there are good reasons for this insulation. first, it means that content scripts don't leak objects to web pages, potentially opening up security holes. second, it means that content scripts can create objects without worrying about whether they might clash with objects added by page scripts. this insulation means that, for example, if a web page loads the jquery library, then the content script won't be able to see the jquery object added by the library - but the content script can add its own jquery object, and it won't clash with the page script's version. interacting with page scripts usually the insulation between content scripts and page scripts is what you want. but sometimes you might want to interact with page scripts: you might want to share objects b...
Finding window handles - Archive of obsolete content
.queryinterface(ci.nsidocshelltreeitem) .treeowner .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsibasewindow); var hwndstring = basewindow.nativehandle; components.utils.import('resource://gre/modules/ctypes.jsm'); var user32 = ctypes.open('user32.dll'); /* http://msdn.microsoft.com/en-us/library/ms633539%28v=vs.85%29.aspx * bool winapi setforegroundwindow( * __in_ hwnd hwnd * ); */ var setforegroundwindow = user32.declare('setforegroundwindow', ctypes.winapi_abi, ctypes.bool, // return bool ctypes.voidptr_t // hwnd ); var hwnd = ctypes.voidptr_t(ctypes.uint64(hwndstring)); var rez_setforegroundwindow = setforegroundwindow(hwnd); console.log('rez_setforegroundwindow:', rez...
...bnavigation) .queryinterface(ci.nsidocshelltreeitem) .treeowner .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsibasewindow); var nswindowstring = basewindow.nativehandle; components.utils.import('resource://gre/modules/ctypes.jsm'); var objc = ctypes.open(ctypes.libraryname('objc')); // types let id = ctypes.voidptr_t; let sel = ctypes.voidptr_t; // constants let nil = ctypes.voidptr_t(0); //common functions let sel_registername = objc.declare('sel_registername', ctypes.default_abi, sel, ctypes.char.ptr); let objc_msgsend = objc.declare('objc_msgsend', ctypes.default_abi, id, id, sel, '...'); /* https://developer.apple.com/library/mac/documentation/cocoa/ref...
StringView - Archive of obsolete content
the aims of this library are: to create a c-like interface for strings (i.e., an array of character codes — an arraybufferview in javascript) based upon the javascript arraybuffer interface to create a highly extensible library that anyone can extend by adding methods to the object stringview.prototype to create a collection of methods for such string-like objects (since now: stringviews) which work strictly on arrays of numbers rather than on creating new immutable javascript strings to work with unicode encodings other than javascript's default utf-16 domstrings introduction as web applications become more and more powerful, adding features such as audio and video manipulation, access to raw data using websockets, and so forth, it has become clear that there are times when it...
...ments for utf-8, 1-2 uint16 elements for utf-16, 1 uint32 element for ucs4, 1 uint8 element for ascii, or something else. byte a collection of 8 bits. null codepoint the character whose codepoint is equal to 0 ('\0'). notes when you include the script stringview.js into a page, no variables other than stringview itself will be added to the global scope. stringview is a highly extensible library, that anyone can extend by adding methods to the object stringview.prototype. for example, imagine you want to create a method similar to string.replace(), but for stringview objects. maybe you would like to solve a situation like the following: var omystringview = new stringview("hello,&nbsp;strange&nbsp;people!"); // utf-8 var omyregexp = new clikeregexp("&nbsp;", "g"); alert(omystringview...
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
. unicharutils has been modified to provide a frozen-linkage comparator: nsstring mystring = somestring; - if (mystring.equals(otherstring, nscaseinsensitivestringcomparator())) + if (mystring.equals(otherstring, caseinsensitivecompare)) return ns_ok; // woot, we're equal in all things but case when using unicharutils from frozen-linkage code, link against the unicharutil_external_s static library. the frozen string api doesn't implement the left(), mid(), or right() signatures. use stringhead(), substring(), and stringtail() instead: nsstring buffer = somestring; - nscautostring prefix;- buffer.left(prefix, 4); + const nsdependentsubstring prefix = stringhead(buffer, 4); the frozen string api doesn't use nssubstringtuple objects and maintains all strings in a contiguous buffer. this me...
...ess(rv, rv);++ rv = rawstream->setdata((const char*)data, length); ns_ensure_success(rv, rv); nsistringinputstream is not frozen (and thus, not available in the gecko sdk as currently published). in order to use this interface in your code, you will need to get the idl files from the source (via cvs, from a tarball, or using lxr). the following functions, however, are implemented in the glue library and can be used from frozen-linkage code: ns_newarrayenumerator (excluding deprecated nsisupportsarray version) ns_newemptyenumerator ns_newunionenumerator nscrt functions in nscrt.h are not available to frozen-linkage code. some of the constants are still useful though. - #include "nscrt.h" + #include <string.h> const char *str = "foo"; - pruint32 len = nscrt::strlen(str); + pruint32 len = ...
Appendix: What you should know about open-source software licenses - Archive of obsolete content
hort, any modification to gpl-licensed software must also be released under the gpl license. the gpl does not state whether linked files and the like are considered “derivative works under copyright law.” the lgpl does make the declaration below. in short, under the gpl, statically or dynamically linked libraries both could be interpreted as derivative works. when a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. the ordinary general public license therefore permits such linking only if the entire combination fits its criteria of freedom. the lesser general public license permits more lax criteria for linking other code with the library. under the lgpl, a pr...
...note that the fsf currently does not recommend applying the lgpl to libraries. pros and cons programs that have been released under the gpl mandate that any derivative works also be released under the gpl, so the code cannot be wrapped in a proprietary program. ...
Drag and Drop JavaScript Wrapper - Archive of obsolete content
you. it works by providing an object which implements the event handlers. all you have to do is write some simpler functions which work with the data being dragged. this drag and drop interface is stored in the global package, in the file chrome://global/content/nsdraganddrop.js. you can include this file in your xul file with the script tag in the same way you would include your own scripts. the library also depends on another script library, which you should also include, usually at the top of your xul file. you can look at the contents of these files to see how drag and drop is done at a lower level. note that you can only use these libraries from within xul loaded via a chrome url. <script src="chrome://global/content/nsdraganddrop.js" /> <script src="chrome://global/content/nstransferable.js...
...the object contains a series of functions, one for each event handler (except for dragenter where it has nothing special to do). each of the functions takes two parameters, the first is the event object and the second is an observer object that you create. more on that in a moment. ...
JSS build instructions for OSX 10.6 - Archive of obsolete content
y compiling errors. ...
...s_4_3_2_rtm jss build nss for 32 and 64: cd mozilla/security/nss make nss_build_all cc="gcc -arch i386" ccc="g++ -arch i386" make nss_build_all use_64=1 build jss for 32 and 64: cd ../jss make cc="gcc -arch i386" ccc="g++ -arch i386" make use_64=1 on osx, java.library.path doesnt seem to have /usr/lib or other paths. temporal solution: copy libs to java dir /usr/lib/java. setting ld_library_path didnt work ...
GRE - Archive of obsolete content
d in xpcom/glue/standalone/nsxpcomglue.h). this allows the embedder to specify what version(s) of gre are appropriate, and to specify any special features the gre must have (currently there are no special features defined). statically link to xpcomglue.lib (the "standalone glue") the solution is to statically link against xpcomglue.lib, also known as the "standalone glue" (see xpcom glue). this library provides a layer of indirection between embedding code and xpcom. to use the xpcom glue, you must follow these steps: compile your code with xpcom_glue defined. link with xpcomglue.lib (not xpcomglue_s.lib!). don't link against the nspr libs. find a compatible gre (see above). dynamically link to that gre using the xpcomgluestartup() function. see environment variables below. initialize xp...
...atible gre (see above). dynamically link to that gre using the xpcomgluestartup() function. see environment variables below. initialize xpcom and do your work; when finished, shut down xpcom. unlink xpcom with xpcomglueshutdown(). dependent libraries and environment variables the xulrunner gre is designed so that the embedder does not need to set any environment variables such as path or ld_library_path before calling xpcomgluestartup(), because it dynamically loads the correct dependent libraries. unfortunately, the mozilla suite-based gre is not as forgiving, especially on linux. embedders will need to set the ld_library_path environment variable and start a new process in order to embed a suite-based gre correctly. ...
JavaScript crypto - Archive of obsolete content
certificate() { window.crypto.importusercertificates(nickname, cert, forcebackup); return false; } document.forms[0].onsubmit = loadcertificate; </script> signing text domstring signtext(domstring stringtosign, domstring caoption /* ... */); loading pkcs #11 modules long deletemodule(domstring modulename); long addmodule(domstring modulename, domstring libraryfullpath, long cryptomechanismflags, long cipherflags); loads or removes a new pkcs #11 module. in the add case, the module will be placed in the nss secmod.db database and will be loaded automatically on application restart. in the delete case, the module is removed from the nss secmod.db. this function will issue a user prompt to confirm the operation before the a...
...flags); loads or removes a new pkcs #11 module. in the add case, the module will be placed in the nss secmod.db database and will be loaded automatically on application restart. in the delete case, the module is removed from the nss secmod.db. this function will issue a user prompt to confirm the operation before the add or delete actually occurs. parameters modulename name of the module. libraryfullpath the filename of the library prepended with its full path. cryptomechanismflags a bit vector indicating all cryptographic mechanisms should be turned on by default (see below). cipherflags a bit vector indicating all ssl or s/mime cipher functions supported by the module (see below). mechanism flag definitions in general, most tokens should not set any of the cipher flags. setting ...
Nanojit - Archive of obsolete content
both the tamarin jit and the spidermonkey jit (a.k.a. tracemonkey) use nanojit as their back end. you can get nanojit by cloning the tamarin-redux mercurial repository at http://hg.mozilla.org/tamarin-redux. it's in the nanojit directory. the input for nanojit is a stream of nanojit lir instructions. the term lir is compiler jargon for a language used internally in a compiler that is usually cross-platform but very close to machine language. it is an acronym for "low-level intermediate representation". ...
... of this snippet includes code where the raw lir is first converted into machine code.(where compile(fragmento->assm(), f); is called basically). then a pointer to a function is used, which takes an int as input and returns the sum of that parameter with two. (typedef js_fastcall int32_t (*addtwofn)(int32_t); ) then, printf is hardcoded to call it with a parameter 5, and on linking with nanojit library, the following program will display 2+5=7 now, what i need to do is generate output for this: start two = int 2 twoplustwo = add two, two ret twoplustwo this adds two and two in the most hardcoded way possible. the conversion from lir to a program like one shown above is the task of the parser. guards guards are special lir instructions, similar to conditional branches, with the differen...
Standalone XPCOM - Archive of obsolete content
application and a component. this should get built by default. nstestsample is the sample application. this should have been installed in your bin/ directory. libsample.so (unix) is the sample component implementation that the sample application will try to instantiate. this should have been installed in your bin/components directory to run the test, cd to your bin/ directory setenv ld_library_path . ./nstestsample warning: mozilla_five_home not set. nsnativecomponentloader: autoregistering begins. nsnativecomponentloader: autoregistering succeeded inital print: initial value set value to: xpcom defies gravity final print : xpcom defies gravity test passed. test failed: what went wrong? the most common case of why the sample would have failed if you didn't run it from...
...pcom defies gravity final print : xpcom defies gravity test passed. test failed: what went wrong? the most common case of why the sample would have failed if you didn't run it from the bin directory. here are some error messsages and possible ways of fixing them. ./nstestsample: error in loading shared libraries: libxpcom.so: cannot open shared object file: no such file or directory ld_library_path not set. to fix, setenv ld_library_path . (note the dot). link errors when building xpcom standalone this is usually due to xpcom not being built standalone. make sure you did configure --enable-standalone-modules=xpcom. what's the difference between standalone and non-standalone xpcom? there is no binary difference between standalone xpcom and the xpcom that ships with the mozilla brow...
Static Analysis for Windows Code under Linux - Archive of obsolete content
r file in `cat .hg/patches/series`; do cat .hg/patches/$file; done) |patch -p1 cd .. now, the gcc source with plugin supports is ready, we should now build a cross compiler from this source. and the instructions are exactly the same with the one here. follow that instructions strictly for making a cross compiler. build dehydra for cross-compiler build the dehydra plugin dehydra is a shared library which will be loaded by the above plugin-support gcc. build dehydra for a cross compiler has nothing difference with building one for a linux native compiler. so, please follow this link exactly. check the build make check if all tests past, you have gotten a workable dehydra. build treehydra build the treehydra plugin building treehydra for a cross compiler is something tricky. that is ...
... cross compiler has nothing difference with building one for a linux native compiler. so, please follow this link exactly. check the build make check if all tests past, you have gotten a workable dehydra. build treehydra build the treehydra plugin building treehydra for a cross compiler is something tricky. that is because the gcc with plugin support is needed to produce treehydra shared library. but we just made a mingw cross compiler, that means it can't produce the correct shared library. so, we should make a linux native compiler with plugin support to make treehydra! this sound crazy, but it may be the only right way to do this. just follow this and this to compile both dehydra and treehydra shared libraries. and these libraries can be used directly with our cross compiler. check ...
The new nsString class implementation (1999) - Archive of obsolete content
adestoffset); static print32 compare(const nsstrimpl& adest,const nsstrimpl& asource, print32 acount,prbool aignorecase); }; nsstring the nsstring class is still with us as a subclass (wrapper) of nsstrimpl. by default, nsstrings use a 2-byte ucs2 character storage model. the nsstring class is very lightweight since it gets its functionality from the nsstrimpl static library. in addition to the nsstrimpl api shown above, nsstring, nsautostring and nscstring all offer additional api's (that all degrade to those found in nsstrimpl) for construction, searching and comparison. also note that the new nsstring interface mimics fully the interface in the existing nsstring class found in mozilla/base/src/nsstring.h. nsautostring we still offer an nsautostring that provides i...
...rface. usage patterns how to use these classes to increase the portability, thread and process safety of gecko, i suggest the following rules regarding the use of each of our string class derivatives: <center> string class</center> <center> where to use</center> nsstrimpl use to pass strings between modules who have linked the nsstrimpl function library. nsstring use these locally in objects who span of control is known to live within your own process. these should typically not be exposed to objects in other modules. nsautostring use these locally in cases where you don't want to incur heap allocation unless absolutely necessary. nscstring same as nsstring, but should be used with caution because of localizat...
Treehydra Manual - Archive of obsolete content
print(fn); let cfg = function_decl_cfg(fn); } } gimple reference for a detailed description of gimple see gcc/tree.def and gcc/cp/operators.def see also treehydra.js, gcc_compat.js, gcc_util.js, and gcc_print.js in the treehydra libs directory, which have many ports of gcc macros and other functions for conveniently accessing gimple data in javascript. esp abstract interpretation library treehydra includes a library for creating abstract interpretation analyses based on esp. users only need to define their esp property variables, abstract values, and the flow semantics of gimple statements, and the library will do all of the substate tracking and fixed-point solving. the library is at unstable/esp.js. there is a sample application that checks for double-locking in a simple mutex...
... value. a value used in the analysis script that represents a set of concrete values. e.g., nonzero. in esp, these are user-defined. concrete state. a memory state in the programming language being analyzed. in other words, a mapping from program variables to concrete values. abstract state. conceptually, this is an object used in the analysis that represents a set of concrete states. in the esp library, these are esp.state objects. bottom. this is a special abstract state the represents the empty set of concrete states. if the state is bottom at a certain program point, that means that program point is unreachable. in esp, this is esp.not_reached. top. this is a special abstract state that represents all possible states. top is also used to name a special abstract value that represents all pos...
URIs and URLs - Archive of obsolete content
everage a pre-existing, large, and widely-used set of resource identifiers. resource a resource can be anything that has identity. familiar examples include an electronic document, an image, a service (e.g., "today's weather report for los angeles"), and a collection of other resources. not all resources are network "retrievable"; e.g., human beings, corporations, and bound books in a library can also be considered resources. the resource is the conceptual mapping to an entity or set of entities, not necessarily the entity which corresponds to that mapping at any particular instance in time. thus, a resource can remain constant even when its content---the entities to which it currently corresponds---changes over time, provided that the conceptual mapping is not changed in the process.
...o might be necessary to implement a new urlparser for a new protocol but that might not be necessary because necko already provides uri implementations that can deal with a number of schemes, by implementing the generic urlparser defined in rfc 2396. nsiuri and nsiurl in a strict sense necko does only know urls, uris by the above definition are much too generic to be properly represented inside a library. there are however two interfaces which loosely relate to the distinction between uri and url as per the above definition: nsiuri and nsiurl. nsiuri represents access to a very simple, very generic form of an url. simply speaking it's scheme and non-scheme, separated by a colon, like "about". nsiurl inherits from nsiuri and represents access to typical urls with schemes like "http", "ftp", ... ns...
XULRunner 1.8.0.1 Release Notes - Archive of obsolete content
r windows/linux from a command prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation. remove the xulrunner directory. mac os x if you have multiple versions of xulrunner installed on mac os x, it is not possible to uninstall only one version. to remove all installed versions of xulrunner, remove the /library/frameworks/xul.framework directory. installing xul applications xul applications can be obtained from various sources, and are typically packaged as a zip archive with the extension .xulapp or .xpi. sample applications are available from the mozilla developer center. save the application archive to your desktop or another convenient place. windows run the following command from the start men...
...p or another convenient place. ...
XULRunner 1.8.0.4 Release Notes - Archive of obsolete content
indows from a command prompt, run xulrunner.exe --unregister-global or xulrunner.exe --unregister-user to unregister xulrunner just as you registered it during installation. remove the xulrunner directory. mac os x if you have multiple versions of xulrunner installed on mac os x, it is not possible to uninstall only one version. to remove all installed versions of xulrunner, remove the /library/frameworks/xul.framework directory. installing xul applications xul applications can be obtained from various sources, and are typically packaged as a zip archive with the extension .xulapp or .xpi. sample applications are available from the mozilla developer center. save the application archive to your desktop or another convenient place. windows run the following command from the start...
...other convenient place. ...
XULRunner 1.9.1 Release Notes - Archive of obsolete content
windows from a command prompt, run xulrunner.exe --unregister-global or xulrunner.exe --unregister-user to unregister xulrunner just as you registered it during installation. remove the xulrunner directory. mac os x if you have multiple versions of xulrunner installed on mac os x, it is not possible to uninstall only one version. to remove all installed versions of xulrunner, remove the /library/frameworks/xul.framework directory. installing xul applications xul applications can be obtained from various sources, and are typically packaged as a zip archive with the extension .xulapp or .xpi. sample applications are available from the mozilla developer center. save the application archive to your desktop or another convenient place. windows run the following command from the start men...
...top or another convenient place. ...
XULRunner 1.9.2 Release Notes - Archive of obsolete content
ory. windows from a command prompt, run xulrunner.exe --unregister-global or xulrunner.exe --unregister-user to unregister xulrunner just as you registered it during installation. remove the xulrunner directory. mac os x if you have multiple versions of xulrunner installed on mac os x, it is not possible to uninstall only one version. to remove all installed versions of xulrunner, remove the /library/frameworks/xul.framework directory. you also need to remove the receipt, especially if you plan on reinstalling a different version. type sudo rm /var/db/receipts/org.mozilla.xulrunner.* installing xul applications xul applications can be obtained from various sources, and are typically packaged as a zip archive with the extension .xulapp or .xpi. sample applications are available from the mozil...
...top or another convenient place. ...
XULRunner 1.9 Release Notes - Archive of obsolete content
indows from a command prompt, run xulrunner.exe --unregister-global or xulrunner.exe --unregister-user to unregister xulrunner just as you registered it during installation. remove the xulrunner directory. mac os x if you have multiple versions of xulrunner installed on mac os x, it is not possible to uninstall only one version. to remove all installed versions of xulrunner, remove the /library/frameworks/xul.framework directory. installing xul applications xul applications can be obtained from various sources, and are typically packaged as a zip archive with the extension .xulapp or .xpi. sample applications are available from the mozilla developer center. save the application archive to your desktop or another convenient place. windows run the following command from the start...
...r another convenient place. ...
XULRunner 2.0 Release Notes - Archive of obsolete content
ory. windows from a command prompt, run xulrunner.exe --unregister-global or xulrunner.exe --unregister-user to unregister xulrunner just as you registered it during installation. remove the xulrunner directory. mac os x if you have multiple versions of xulrunner installed on mac os x, it is not possible to uninstall only one version. to remove all installed versions of xulrunner, remove the /library/frameworks/xul.framework directory. installing xul applications xul applications can be obtained from various sources, and are typically packaged as a zip archive with the extension .xulapp or .xpi. sample applications are available from the mozilla developer center. save the application archive to your desktop or another convenient place. windows run the following command from the start menu ...
...sktop or another convenient place. ...
mozilla.dev.platform FAQ - Archive of obsolete content
in you <tt>mozconfig --enable-storage</tt> q: program received signal exc_bad_instruction, illegal instruction/operand. 0x00016b50 in xre_createappdata () a: when you <tt>--disable-libxul</tt>, the xpcom glue doesn't have information about how to load all the dependent libraries like <tt>libgfx.dylib</tt>. in order to use xr successfully in <tt>--disable-libxul</tt> mode, you have to setup dyld_library_path to include <tt>/library/frameworks/xul.framework/versions/1.9a1</tt> - benjamin smedberg, fri, oct 20 2006 9:12 am q: when i try to build a completely standalone xul app on os x (10.4.8). took an foo.app directory created with xulrunner-bin --install-app and tried to copy (using rsync -rl) the xul.framework directory into a frameworks directory in the .app bundle and then deleting the xul.
...ary/frameworks/xul.framework/versions/1.9a1</tt> - benjamin smedberg, fri, oct 20 2006 9:12 am q: when i try to build a completely standalone xul app on os x (10.4.8). took an foo.app directory created with xulrunner-bin --install-app and tried to copy (using rsync -rl) the xul.framework directory into a frameworks directory in the .app bundle and then deleting the xul.framework directory from /library/frameworks, my running my app fails silently. it works fine when the xul.framework is installed in /library/frameworks. any suggestions? " a: make sure the app can find the framework or you can use the packages of the firefox release repackager which uses the embedded framework successfully. please make sure you're using 1.8.0.4 or later (not 1.8.0.1, which had a bug that prevented this from work...
2006-10-27 - Archive of obsolete content
ation=browser --disable-tests --disable-debug -disable-auto-deps --disable-freetype2 -enable-official-branding --enable-default-toolkit=gtk2 --enable-optimize=-xo5 --enable-static --disable-shared --enable-xft --enable-svg the build tools that he used to build firefox 2 are listed in his posting along with the error that he receives when he tries to build it. alex is not sure if he is missing a library or if he needs to pass extra options to configure the build. peter weilbacher responded to alex's posting on the same day, stating that he is not sure what packaging system solaris 10 x86 uses but thinks that he might need to install the developer packages of x and/or xrender and freetype which should contain the libxrender.* and libfreetype.* files that are need for the linking. october 27...
... not sure what packaging system solaris 10 x86 uses but thinks that he might need to install the developer packages of x and/or xrender and freetype which should contain the libxrender.* and libfreetype.* files that are need for the linking. october 27: alex responded to peter weilbacher posting stating that he is going to look for a solaris newsgroup because he is not sure how to check if the library is installed or where to get the packages. october 26: masaki responded to alex's posting by providing a link to a similar bug that provides a work around to the problem he was having. the solution that masaki suggested was to add "-l/usr/sfw/lib" into moz_cairo_libs of config/autoconf.mk. moz_cairo_libs = -l$(libxul_dist)/lib -lmozcairo -lmozlibpixman \ -l/usr/sfw/lib -lxrender -lfreety...
NP_Shutdown - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary provides global deinitialization for a plug-in. syntax #include <npapi.h> void np_shutdown(void); windows #include <npapi.h> void winapi np_shutdown(void); description the browser calls this function once after the last instance of your plug-in is destroyed, before unloading the plug-in library itself. use np_shutdown to delete any data allocated in np_initialize to be shared by all instances of a plug-in. if you have defined a java class for your plug-in, be sure to release it at this time so that java can unload it and free up memory. note: if enough memory is available, the browser can keep the plug-in library loaded if it expects to create more instances in the near future. the browser calls np_shutdown o...
...data allocated in np_initialize to be shared by all instances of a plug-in. if you have defined a java class for your plug-in, be sure to release it at this time so that java can unload it and free up memory. note: if enough memory is available, the browser can keep the plug-in library loaded if it expects to create more instances in the near future. the browser calls np_shutdown only when the library is finally unloaded. see also np_initialize, npp_destroy ...
Using Firebug and jQuery (Screencast) - Archive of obsolete content
note: this screencast is originally from: http://ejohn.org/blog/hacking-digg-w...ug-and-jquery/ this is an adaptation of a presentation that i gave while at mashup camp boston. we're going to take an introductory look at the firebug firefox extension and the jquery javascript library - combining the two to build a reusable bookmarklet that can manipulate digg posts and comments. click the video link to begin (14:39 minutes long, 59mb): http://developer.mozilla.org/presentations/screencasts/jresig-digg-firebug-jquery.mp4 download: right-click this link and select save as... in order to download a copy of your own. (59mb) bookmarklets: in the presentation, i refer to a bookmarklet that you can use to introduce jquery into a web page. drag these bookmarklets found on this page into...
...4 download: right-click this link and select save as... in order to download a copy of your own. (59mb) bookmarklets: in the presentation, i refer to a bookmarklet that you can use to introduce jquery into a web page. drag these bookmarklets found on this page into the bookmarks toolbar of your browser, in order to use them. related links: firebug firefox extension jquery javascript library jquery selector documentation digg learning jquery: jquerify bookmarklet if you wish to use greasemonkey instead of a bookmarklet, then by all means, please do so. you can use the ability to quickly analyze and inspect a page that firebug and jquery affords you, using the results to build a greasemonkey script, instead of a simple bookmarklet. i only really intended this to be a quick introd...
Writing JavaScript for XHTML - Archive of obsolete content
e future. solution: avoid html-specific dom the html dom , even though it is compatible with xhtml 1.0, is not guaranteed to work with future versions of xhtml (perhaps especially the formatting properties which have been deprecated as element attributes). the regular xml dom provides sufficient methods via the element interface for getting/setting/removing attributes. ...
...if they get the hint and are not too annoyed, perhaps they start to implement xml features in their libraries. i read about e4x. ...
Index - Game development
techniques used to implement collision detection in 3d environments. followup articles will cover implementations in specific 3d libraries. 14 bounding volume collision detection with three.js 3d, games, javascript, webgl, bounding boxes, collision detection, three.js this article shows how to implement collision detection between bounding boxes and spheres using the three.js library. it is assumed that before reading this you have read our 3d collision detection introductory article first, and have basic knowledge about three.js. 15 3d games on the web games, graphics, needscontent, needsexample, webgl, webvr, three.js for rich gaming experiences on the web, the weapon of choice is webgl, which is rendered on html <canvas>. webgl is basically an opengl e...
...lly building prototypes and demos, without having to write a lot of javascript or glsl. this article explains how to get up and running with a-frame, and how to use it to build up a simple demo. 17 building up a basic demo with babylon.js 3d game engines, babylon.js, beginner, webgl babylon.js is one of the most popular 3d game engines used by developers. as with any other 3d library it provides built-in functions to help you implement common 3d functionality more quickly. in this article we'll take you through the real basics of using babylon.js, including setting up a development environment, structuring the necessary html, and writing the javascript code. 18 building up a basic demo with playcanvas 3d, animation, beginner, canvas, games, playcanvas, tutorial...
Routers - MDN Web Docs Glossary: Definitions of Web-related terms
there are two definitions for routers on the web: for the network layer, the router is a networking device that decides data packets directions. they are distributed by retailers allowing user interaction to the internet. for spa in application layer, router is a library that decides what web page is presented by a given url. ...
... layer, router is a library that decides what web page is presented by a given url. this middleware module is used for all url functions, as these are given a path to a file that is rendered to open the next page. ...
Advanced form styling - Learn web development
an't consistently set things like spacing and colors. for example, firefox will apply color and background-color when set on the <option> elements, chrome won't. neither of them will apply any kind of spacing (e.g. padding). the same is also true of the autocomplete list that appears for the datalist. if you really need full control over the option styling, you'll have to either use some kind of library to generate a custom control, or build your own custom control, or in the case of select use the multiple attribute, which makes all the options appear on the page, sidestepping this particular problem: <select id="select" name="select" multiple> ... </select> of course, this might also not fit in with the design you are going for, but it's worth noting! date input types the date/time input...
...asy to style as any text input, and what we've got in this demo looks fine. however, the internal parts of the control (e.g. the popup calendar that you use pick a date, the spinner that you can use to increment/decrement values) are not stylable at all, and you can't get rid of them using appearence: none;. if you really need full control over the styling, you'll have to either use some kind of library to generate a custom control, or build your own. note: it is worth mentioning <input type="number"> here too — this also has a spinner that you can use to increment/decrement values, so potentially suffers from the same problem. however, in the case of the number type the data being collected is simpler, and it is easy to just use a text input type instead if desired (or tel if you want mobil...
HTML forms in legacy browsers - Learn web development
to work with "unobtrusive" javascript. it's a development pattern that defines two requirements: a strict separation between structure and behaviors. if the code breaks, the content and the basic functionalities must remain accessible and usable. the principles of unobtrusive javascript (originally written by peter-paul koch for dev.opera.com) describes these ideas very well. the modernizr library there are many cases where a good "polyfill" can help a lot by providing a missing api. a polyfill is a bit of javascript that "fills in the holes" in the functionality of legacy browsers. while they can be used to improve support for any functionality, using them for javascript is less risky than for css or html; there many cases where javascript can break (network issues, script conflicts, etc...
...owsers. while they can be used to improve support for any functionality, using them for javascript is less risky than for css or html; there many cases where javascript can break (network issues, script conflicts, etc.). but for javascript, if you work with unobstructive javascript in mind, if polyfills are missing, it's no big deal. the best way to polyfill missing api is by using the modernizr library and its spin-off project: yepnope. modernizr is a library that allows you to test the availability of functionality in order to act accordingly. yepnope is a conditional loading library. here is an example: modernizr.load({ // this tests if your browser supports the html5 form validation api test : modernizr.formvalidation, // if the browser does not support it, the following polyfill is...
How to build custom form controls - Learn web development
array and because foreach is so convenient to use, we can easily add the support of foreach to nodelist in order to make our life easier, like so: nodelist.prototype.foreach = function (callback) { array.prototype.foreach.call(this, callback); } if you need to support legacy browsers, ensure the browsers support these features. if not, you can iterate through the list or you may need to use a library or pollyfill. building event callbacks the groundwork is done. we can now start to define all the functions that will be used each time the user interacts with our control. // this function will be used each time we want to deactivate a custom control // it takes one parameter // select : the dom node with the `select` class to deactivate function deactivateselect(select) { // if the contro...
...nts, or use a framework to implement a pre-baked control, remember that creating a usable and accessible form control is more complicated than it looks. here are a few libraries you should consider before coding your own: jquery ui axe accessible custom select dropdowns msdropdown nice forms if you do create alternative controls via radio buttons, your own javascript, or with a 3rd party library, ensure it is accessible and feature-proof; that is, it needs to be able to work better with a variety of browsers whose compatibility with the web standards they use vary. have fun! ...
Installing basic software - Learn web development
for serious web development, it's better to invest in a desktop or laptop computer running windows, macos or linux. ...
...web hosting accounts to manage files on servers (git is increasingly replacing ftp for this purpose). there are loads of (s)ftp programs available including cyberduck, fetch and filezilla. an automation system, like webpack, grunt, or gulp to automatically perform repetitive tasks, such as minifying code and running tests. libraries, frameworks, etc., to speed up writing common functionality. a library tends to be an existing javascript or css file that provides ready-rolled functionality for you to make use of in your code. a framework tend to take this idea further, offering a complete system with some custom syntaxes for you to write a web app on top of. more tools besides! what tools do i actually need, right now? that looks like a scary list, but fortunately, you can get started in web...
Choosing the right approach - Learn web development
once for each level of nesting, whereas with promises you can just use a single .catch() block to handle the errors for the entire chain. async callbacks just aren't very graceful. promise callbacks are always called in the strict order they are placed in the event queue; async callbacks aren't. async callbacks lose full control of how the function will be executed when passed to a third-party library. browser compatibility really good general support, although the exact support for callbacks in apis depends on the particular api. refer to the reference documentation for the api you're using for more specific support info. further information introducing asynchronous javascript, in particular async callbacks settimeout() settimeout() is a method that allows you to run a function afte...
... or in the top level context of your code. this can sometimes result in an extra function wrapper needing to be created, which can be slightly frustrating in some circumstances. but it is worth it most of the time. browser support for async/await is not as good as that for promises. if you want to use async/await but are concerned about older browser support, you could consider using the babeljs library — this allows you to write your applications using the latest javascript and let babel figure out what changes if any are needed for your user’s browsers. browser compatibility desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsasync functionchrome full supp...
Introduction to client-side frameworks - Learn web development
great distances instantaneously, with text, audio or video chat. the web allows us to do things that used to be possible only in native applications installed on our computers. these modern, complex, interactive websites are often referred to as web applications. the advent of modern javascript frameworks has made it much easier to build highly dynamic, interactive applications. a framework is a library that offers opinions about how software gets built. these opinions allow for predictability and homogeneity in an application; predictability allows software to scale to an enormous size and still be maintainable; predictability and maintainability are essential for the health and longevity of software. javascript frameworks power much of the impressive software on the modern web – including m...
...ngest of the big four, but has enjoyed a recent uptick in popularity. vue, like angularjs, extends html with some of its own code. apart from that, it mainly relies on modern, standard javascript. start learning vue react facebook released react in 2013. by this point, it had already been using react to solve many of its problems internally. react itself is not technically a framework; it's a library for rendering ui components. react is used in combination with other libraries to make applications — react and react native enable developers to make mobile applications; react and reactdom enable them to make web applications, etc. because react and reactdom are so often used together, react is colloquially understood as a javascript framework. as you read through this module, we will be wor...
Strategies for carrying out testing - Learn web development
reenreaders should be able to access the text. a grade: the information box should animate smoothly as it appears/disappears. the gradient and text shadow should appear to enhance the look of the box. you may notice from the text in the example that it won't work in ie8 — this is a problem according to our support chart, which you'll have to work on, perhaps by using a feature detection library to implement the functionality in a different way if the browser doesn't support css transitions (see implementing feature detection, later on in the course). you might also notice that the button isn't usable using only the keyboard — this also needs to be remedied. maybe we could use some javascript to implement a keyboard control for the toggle, or use some other method entirely? these tes...
... just like you would any real installation — for example, as well as installing the browsers you want to test, install an anti-virus program to protect it from viruses. having multiple virtual machines is very useful, particularly for windows ie/edge testing — on windows, you are not able to have multiple versions of the default browser installed side by side, so you might want to build up a library of virtual machines to handle different tests as required, e.g.: windows 10 with edge 14 windows 10 with edge 13 windows 8.1 with ie11 windows 8 with ie10 windows 7 with ie9 windows xp with ie8 windows xp with ie7 windows xp with ie6 note: another good thing about virtual machines is that the virtual disk images are fairly self-contained. if you are working on a team, you can create ...
Setting up your own test automation environment - Learn web development
we will also look at how to integrate your local testing environment with commercial tools like the ones discussed in the previous article. prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high-level principles of cross browser testing, and automated testing. ...
...efore filling in the form field. we then test whether its value got filled in (i.e. is not empty) by using getattribute() to retrieve it's value attribute value, and print a message to the console if it is not empty. note: there is also a method called wait(), which repeatedly tests a condition for a certain length of time, and then carries on executing the code. this also makes use of the util library, which defines common conditions to use along with wait(). shutting down drivers after use after you've finished running a test, you should shut down any driver instances you've opened, to make sure that you don't end up with loads of rogue browser instances open on your machine! this is done using the quit() method. simply call this on your driver instance when you are finished with it. add t...
Cross browser testing - Learn web development
ibility issues. implementing feature detection feature detection involves working out whether a browser supports a certain block of code, and running different code dependent on whether it does (or doesn't), so that the browser can always provide a working experience rather than crashing/erroring in some browsers. this article details how to write your own simple feature detection, how to use a library to speed up implementation, and native features for feature detection such as @supports. introduction to automated testing manually running tests on several browsers and devices, several times per day, can get tedious and time-consuming. to handle this efficiently, you should become familiar with automation tools. in this article, we look at what is available, how to use task runners, and the b...
...iar with automation tools. in this article, we look at what is available, how to use task runners, and the basics of how to use commercial browser test automation apps such as sauce labs and browser stack. setting up your own test automation environment in this article, we will teach you how to install your own automation environment and run your own tests using selenium/webdriver and a testing library such as selenium-webdriver for node. we will also look at how to integrate your local testing environment with commercial apps like the ones discussed in the previous article. ...
Package management basics - Learn web development
e text. you could certainly code this yourself, but there's a strong chance that someone else has already solved this problem — why waste time reinventing the wheel? moreover, a reliable third-party dependency will likely have been tested in a lot of different situations, making it more robust and cross-browser compatible than your own solution. a project dependency can be an entire javascript library or framework — such as react or vue — or a very small utility like our human-readable date library, or it can be a command line tool such as prettier or eslint, which we talked about in previous articles. without modern build tools, dependencies like this might be included in your project using a simple <script> element, but this might not work right out of the box and you will likely need s...
...-project.fb76efcf.js is a whopping 195k — very large, given that all it does is print a line of text. sure there's some calculation, but we definitely don’t need 195k worth of javascript to do this!. when you use development tooling it's worth questioning whether they're doing the right thing for you. in this case, the bundle is nearly 200k because it has in fact included the entire date-fns library, not just the function we're using. if we had avoided any development tools and pointed a <script src=””> element to a hosted version of date-fns, roughly the same thing would have happened — all of the library would be downloaded when our example page is loaded in a browser. however, this is where development tooling has a chance to shine. whilst the tooling is on our machine, we can ask...
Choosing the right memory allocator
for data structures being passed across xpcom boundaries, use ns_alloc() instead. ...
... because the presshell destructor will wipe out the arena, leaving any pointers to memory allocated from it dangling. the corresponding deallocators are nsipresshell::freeframe() and nsprescontext::freetoshell(). notes memory that is allocated with the c standard library (malloc() and free()) should not be passed between shared libraries. these memory buffers may be used within a single shared library or program. for data structures being passed across xpcom boundaries, use ns_alloc() instead. ...
Eclipse CDT
ath to your firefox binary (something like {your-obj-dir}/dist/nightlydebug.app/contents/macos/firefox) and select "disable auto build". select the arguments tab and enter any args you want to pass to firefox (such as "--no-remote -p my-testing-profile"). if you're on linux, you may also need to set the "working directory" to {your-obj-dir}/dist/bin, and then select the environment tab and set ld_library_path to ".:./plugins:." and library_path to ".:./components:.". (are these variables really necessary? if so, why? isn't library_path for compile time, not runtime, linking?) in the workspace preferences, you may want to go to "c/c++ > debug > gdb" and deselect "stop on startup at", so that eclipse won't automatically break in main() when it launches firefox for debugging. to debug, click the d...
... of your mozilla tree, and then delete the workspace directory corresponding to your tree. that's it; you can now create a new eclipse workspace and project for your tree from scratch. isn't there a better method of build option discovery? yes, but eclipse doesn't currently support it. instead of processing build console output, eclipse could use something like ld_preload to load its own little library into all the processes that are invoked as part of the build process. this library could then check whether the process is a compiler instance and, if so, use the processes' current working directory and the arguments that were passed to it to reliably obtain the information it needs for each source file that is compiled. this would eliminate the requirement for non-parallelized, non-silenced bui...
Roll your own browser: An embedding how-to
arted up. included is the sample test application (gtkembed or winembed). what initializations do i have to do? somewhere during the start of your application, you must initialize xpcom. you will also want to shut this down when you quit. other initialization must be done to start up event queues and load some string bundles. all of this is somewhat generic and has been isolated into a static library that you can simply call on. if you build mozilla/embedding/base/, a static library (on windows) called baseembed_s.lib is built. just link this library to your application. there are two functions that are needed: nsresult ns_initembedding(const char *apath); nsresult ns_termembedding(); pretty self-explanatory. the apath parameter will be passed to ns_initxpcom. ns_initembedding() must be c...
...implemented by embedding mozilla. (mozilla blurb) bradsoft's topstyle css builder: implements an internal browser using mozilla activex embedding control.obsolete since gecko 7.0 nxzilla: a set of libraries that allow mozilla to be used with a nanox server. activex control: an activex control allowing for embedding the gecko layout engine.obsolete since gecko 7.0 llmozlib & ubrowser: a static library that allows you to embed gecko and render pages to memory. includes test applications that illustrate how to use it. versions for windows and mac with linux to follow. mozilla examples mfcembed: standard mozilla embedding example application for win32. basic browser, menus, toolbar, urlbar, html area. winembed: obsoleted by mfcembed. a bare-bones browser with urlbar and html area. activex ...
Gecko SDK
t yourself. note: you can subscribe to a calendar of the firefox release schedule. also, you can view the schedule on the web. unpack the sdk tarball to some suitable location. issues with the os x sdk if you need to use the xpidl utility to compile idl files on os x, it's likely that you will receive a strange error when running the tool that looks something along the lines of this: dyld: library not loaded: /opt/local/lib/libintl.3.dylib referenced from: /users/varmaa/xulrunner-sdk/bin/./xpidl reason: image not found trace/bpt trap unfortunately, this is caused by a problem with the sdk build process which cannot currently be resolved (see bugzilla bug #430274). to get around it, you'll need to first install macports as outlined in the mac os x build prerequisites and install libid...
... using the mozilla build system with the sdk it's possible to use the mozilla build system with the sdk. this can be done by downloading the source code for firefox and using the --with-libxul-sdk option to configure. resources static xpidl.exe (non-official) if you are looking for a static linked xpidl.exe, you can download here. mac intel gecko 1.8 sdk the official mac 1.
How Mozilla determines MIME Types
text/plain; charset=iso-8859-1 and the server did not send a content-encoding header, mozilla will sniff the first block of data it gets and check for non-text bytes. text bytes are 9-13, 27, and 31-255. when encountering a non-text byte, the helper app dialog will be shown, showing the mime type corresponding to the extension of the file. also, for images loaded via <img src>, mozilla's image library will do content sniffing (never extension sniffing) to find out the real type of the image. if the server did not send a content-type header, mozilla uses the unknown decoder to find a mime type. file uris for file: uris, mozilla will ask the externalhelperappservice for a mime type. ftp like http uris without a mime type, ftp uris go through the unknown decoder. unknown decoder located at...
...inecontenttype function. it does the following: checks the start of the file for "magic numbers"; this can currently detect pdf and postscript. if the file starts with <?xml, asks the externalhelperappservice for a mime type for the uri. this is done because the generic text/xml mime type does not work for xul files, and xhtml files get a different dom when interpreted as text/xml. the image library will be asked for the mime type given the content. this should allow reliable detection of all image types mozilla supports. checks whether the data is html by looking for some common html tags. the uri is handed to the externalhelperappservice for mime type guessing if all else fails, the buffer (i.e. the first few bytes of the file) is searched for embedded nulls; if none are found, text/pla...
How to get a stacktrace for a bug report
. crash reports are accessible from all firefox profiles, so if a new profile does not crash you can use it to access them through "about:crashes" as above. accessing crash report ids outside of firefox if you cannot load firefox at all you can find the crash report files at this location depending on your operating system: windows : %appdata%\mozilla\firefox\crash reports\submitted\ os x : ~/library/application support/firefox/crash reports/submitted/ linux : ~/.mozilla/firefox/crash reports/submitted/ each file in this folder contains one submitted crash report id. you can check the modified or creation time for each file to discern which crash reports are relevant to your bug report. alternative ways to get a stacktrace if the mozilla crash reporter doesn't come up or isn't available y...
...eport. alternative ways to get a stacktrace if the mozilla crash reporter doesn't come up or isn't available you will need to obtain a stacktrace manually: windows see the article create a stacktrace with windbg for information on how to do this. for a full process dump, see how to get a process dump with windows task manager [en-us] os x run /applications/utilities/console.app. expand "~/library/logs" and "crashreporter", then look for logs for "firefox-bin". linux note that for most distros, the package you need to get symbols for will be something like "xulrunner", not "firefox". crash reports files on your computer when breakpad initially catches a crash it first writes crash report files (e.g. .dump and .extra files) into the 'pending' subdirectory of its 'crash reports' director...
OS.File for the main thread
his page details how to use file i/o from the main thread. for other uses of os.file, please see the corresponding page. using os.file from a jsm to import os.file into your chrome code, add the following line at the start of your script: components.utils.import("resource://gre/modules/osfile.jsm") promises before using os.file from the main thread, you need some understanding of the promise library. see the promise object documentation for details. also, os.file plays very nicely with task.jsm. example: read the contents of a file as text the following snippet opens a file "file.txt" and read its contents as a string, using the default encoding (utf-8). the content is read asynchronously. the result is a promise. let decoder = new textdecoder(); // this decoder can be reused fo...
...ires firefox 16 or a more recent version. example: path manipulation the following snippet obtains the path to file "sessionstore.js", contained in the user's profile directory. let sessionstore = os.path.join(os.constants.path.profiledir, "sessionstore.js"); // under linux, this is generally "$home/.firefox/profiles/$profilename/sessionstore.js" // under macos, this is generally "$home/library/application support/firefox/$profilename/sessionstore.js" // under windows, this is generally "%appdata%\local\temp\%profilename%"\sessionstore.js // etc. example: determine if a file is a directory the following snippet determines if some path represents a file or a directory: let promise = os.file.stat(somepath); promise = promise.then( function onsuccess(stat) { if (stat.isdir...
about:memory
ther content such as images and workers, and for browser subsystems such as the startup cache and xpconnect. some add-on memory usage is identified, as the following example shows. ...
... some add-ons are identified by a name, such as tree style tab. others are identified only by a hex...
About NSPR
netscape portable runtime (nspr) provides platform independence for non-gui operating system facilities. these facilities include threads, thread synchronization, normal file and network i/o, interval timing and calendar time, basic memory management (malloc and free) and shared library linking. history a good portion of the library's purpose, and perhaps the primary purpose in the gromit environment, was to provide the underpinnings of the java vm, more or less mapping the sys layer that sun defined for the porting of the java vm to various platforms. nspr went beyond that requirement in some areas and since it was also the platform independent layer for most of the servers produced by netscape. it was expected and preferred that existing code be restructured and perhaps even rewritten in ord...
... to and from most well-known forms of ascii into the 64-bit nspr representation. memory management nspr provides api to perform the basic malloc, calloc, realloc and free functions. depending on the platform, the functions may be implemented almost entirely in the nspr runtime or simply shims that call immediately into the host operating system's offerings. linking support for linking (shared library loading and unloading) is part of nspr's feature set. in most cases this is simply a smoothing over of the facilities offered by the various platform providers. where it's headed nspr is applicable as a platform on which to write threaded applications that need to be ported to multiple platforms. the current implementation supports macintosh (ppc), win-32 (winnt, win9x) and 20 versions of unix ...
NSPR build instructions
al reasons. we recommend most applications use the "win95" configuration. the "win95" configuration supports all versions of windows. the "win95" name is historical; it should have been named "win32". to generate a "win95" configuration, specify the --enable-win32-target=win95 configure option. --enable-debug-rtl this option is only used on windows. ...
... "win95" configuration supports all versions of windows. the "win95" name is historical; it should have been named "win32". to generate a "win95" configuration, specify the --enable-win32-target=win95 configure option. --enable-debug-rtl this option is only used on windows. nspr debug build uses the release c run-time library by default. to generate a debug build that uses the debug c run-time library, specify the --enable-debug-rtl configure option. makefile targets all (default) clean realclean distclean install release running the test programs the tests were built above, in the pr/tests directory. on mac os x, they can be executed with the following: /bin/sh: $ cd pr/tests $ dyld_library_path=../../dist/lib ./accept pass $ $ # to run all the nspr tests... $ $ dyld_li...
NSPR's Position On Abrupt Thread Termination
own only to the single thread (normally referred to as encapsulated). the problem with abrupt termination is that it can happen at any time, to a thread that is coded correctly to handle both normal and exceptional situations, but will be unable to do so since it will be denied the opportunity to complete execution. it can happen because it called out of its own scope into some lazily implemented library. nspr's answer to this is that there is no abrupt thread termination. all threads must unwind and return from their root function. if they cannot, because of some state corruption, then they must assume that the corruption, like the state, is shared, and their only resource is for the process to terminate. to make this solution work requires that a function that encounters an error be designed su...
...domain, it happens to work (one might even say it's more efficient) to exit from anywhere. but threads are not processes. if threads have to maintain the same type of resource knowledge as a process, they loose all of their benefit. threads are an implementation strategy to provide the illusion of concurrency within a process. they are alternatives to large state machines with mostly non-blocking library functions. when the latter is used to provide concurrency, calling exit() will terminate the entire process. why would anyone expect a thread to behave differently? threads are not processes. original document information author: alan o. freier last updated date: december 1998 ...
PR_FindSymbol
pr_findsymbol() will return an untyped reference to a symbol in a particular library given the identity of the library and a textual representation of the symbol in question. syntax #include <prlink.h> void* pr_findsymbol ( prlibrary *lib, const char *name); parameters the function has these parameters: lib a valid reference to a loaded library, as returned by pr_loadlibrary, or null. name a textual representation of the symbol to resolve. returns an untyped pointer. description this function finds and returns an untyped reference to the specified symbol in the specified library. if the lib parameter is null, all libraries known to the runtime and the main program are searched in an unspecified order. use this function to look up functions or data symbols in a shared libr...
...bol to resolve. returns an untyped pointer. description this function finds and returns an untyped reference to the specified symbol in the specified library. if the lib parameter is null, all libraries known to the runtime and the main program are searched in an unspecified order. use this function to look up functions or data symbols in a shared library. getting a pointer to a symbol in a library does indicate that the library is available when the search was made. the runtime does nothing to ensure the continued validity of the symbol. if the library is unloaded, for instance, the results of any pr_findsymbol calls become invalid as well. ...
Introduction to Network Security Services
pplications that support ssl, s/mime, and other internet security standards. for a general overview of nss and the standards it supports, see overview of nss. shared libraries network security services provides both static libraries and shared libraries. applications that use the shared libraries must use only the apis that they export. three shared libraries export public functions: the ssl library supports core ssl operations. the s/mime library supports core s/mime operations. the nss library supports core crypto operations. we guarantee that applications using the exported apis will remain compatible with future versions of those libraries. for a complete list of public functions exported by these shared libraries in nss 3.2, see nss functions. for information on which static librar...
...e for details.) figure 1 relationships among core nss libraries and nspr naming conventions and special libraries windows and unix use different naming conventions for static and dynamic libraries: windows unix static .lib .a dynamic .dll .so or .sl in addition, windows has "import" libraries that bind to dynamic libraries. so the nss library has the following forms: libnss3.so - unix shared library libnss3.sl - hp-ux shared library libnss.a - unix static library nss3.dll - windows shared library nss3.lib - windows import library binding to nss3.dll nss.lib - windows static library nss, ssl, and s/mime have all of the above forms. the following static libaries aren't included in any shared libraries libcrmf.a/crmf.lib pr...
4.3.1 Release Notes
these flags. see generateeckeypairwithopflags see generatersakeypairwithopflags see generatedsakeypairwithopflags distribution information jss is checked into mozilla/security/jss/. the cvs tag for the jss 4.3.1 release is jss_4_3_1_rtm. source tarballs are available from ftp://ftp.mozilla.org/pub/mozilla.or...-4.3.1.tar.bz2 binary releases are no longer available on mozilla. jss is a jni library we provide the jss4.jar but expect you to build the jss's matching jni shared library. we provide the jss4.jar in case you do not want to obtain your own jce code signing certificate. jss is a jce provider and therefore the jss4.jar must be signed. ftp://ftp.mozilla.org/pub/mozilla.org/security/jss/releases/jss_4_3_1_rtm. documentation documentation for jss 4.3.1 is available as follows: build ...
... a list of reported bugs that have not yet been fixed, click here. note that some bugs may have been fixed since jss 4.3.1 was released. compatibility jss 4.3.1 is backwards compatible with jss 4.2. applications compiled against jss 4.2 will work with jss 4.3.1. the 4.3.1 version of libjss4.so/jss4.dll must only be used with jss4.jar. in general, a jss jar file must be used with the jss shared library from the exact same release. to obtain the version info from the jar file use, "system.out.println(org.mozilla.jss.cryptomanager.jar_jss_version)" and to check the shared library: strings libjss4.so | grep -i header feedback bugs discovered should be reported by filing a bug report with bugzilla. you can also give feedback directly to the developers on the mozilla cryptography forums... ma...
NSS 3.12.4 release notes
ession foo, or the expression bar. at least one '|' separator is required. more are permitted. expressions inside unions may not include unions or exclusions. inside a union, to be matched and not treated as a special character, these characters must be escaped: \ ( | ) [ ~ except when they occur inside a bracketed expression, where only \ and ] require escaping. new functions in the nss shared library: pk11_isinternalkeyslot (see pk11pub.h) secmod_opennewslot (see pk11pub.h) new error codes (see secerr.h): sec_error_bad_info_access_method sec_error_crl_import_failed new oids (see secoidt.h) sec_oid_x509_any_policy the nssckbi pkcs #11 module's version changed to 1.75. obsolete code for win16 has been removed. support for openvms has been removed. bugs fixed the following bugs h...
...bug 488396: dbm needs to be fips certifiable. bug 488550: crash in certutil or pp when printing cert with empty subject name bug 488992: fix lib/freebl/win_rand.c warnings bug 489010: stop exporting mktemp and dbopen (a...
NSS 3.14 release notes
bugzilla.mozilla.org/show_bug.cgi?id=565047). to better support tls 1.1 and future versions of tls, a new version range api was introduced to allow applications to specify the desired minimum and maximum versions. these functions are intended to replace the now-deprecated use of the ssl_enable_ssl3 and ssl_enable_tls socket options. the following functions have been added to the libssl library included in nss 3.14 ssl_versionrangeget (in ssl.h) ssl_versionrangegetdefault (in ssl.h) ssl_versionrangegetsupported (in ssl.h) ssl_versionrangeset (in ssl.h) ssl_versionrangesetdefault (in ssl.h) to better ensure interoperability with peers that support tls 1.1, nss has altered how it handles certain ssl protocol layer events. suc...
...anges" section below. experimental support for dtls (rfc 4347) and dtls-srtp (rfc 5764) dtls client and server support has been added in nss 3.14. because the test coverage and interoperability testing is not yet at the same level as other nss code, this feature should be considered "experimental" and may contain bugs. the following functions have been added to the libssl library included in nss 3.14: dtls_importfd (in ssl.h) dtls_gethandshaketimeout (in ssl.h) ssl_getsrtpcipher (in ssl.h) ssl_setrtpciphers (in ssl.h) support for aes-gcm support for aes-gcm has been added to the nss pkcs #11 module (softoken), based upon the draft 7 of pkcs #11 v2.30. warning: because of ambiguity in the current draft text, applicati...
NSS 3.18 release notes
errenamecertnicknames. the tstclnt test utility program has new command-line options -c, -d, -b and -r. use -c one, two or three times to print information about the certificates received from a server, and information about the locally found and trusted issuer certificates, to diagnose server side configuration issues. it is possible to run tstclnt without providing a database (-d). a pkcs#11 library that contains root ca certificates can be loaded by tstclnt, which may either be the nssckbi library provided by nss (-b) or another compatible library (-r). new functions in certdb.h sec_checkcrltimes - check the validity of a crl at the given time. sec_getcrltimes - extract the validity times from a crl. in p12.h sec_pkcs12decoderrenamecertnicknames - call an applicat...
... notable changes in nss 3.18 the highest tls protocol version enabled by default has been increased from tls 1.0 to tls 1.2. similarly, the highest dtls protocol version enabled by default has been increased from dtls 1.0 to dtls 1.2. the default key size used by certutil when creating an rsa key pair has been increased from 1024 bits to 2048 bits. on mac os x, by default the softokn shared library will link with the sqlite library installed by the operating system, if it is version 3.5 or newer. the following ca certificates had the websites and code signing trust bits turned off ou = equifax secure certificate authority sha1 fingerprint: d2:32:09:ad:23:d3:14:23:21:74:e4:0d:7f:9d:62:13:97:86:63:3a cn = equifax secure global ebusiness ca-1 sha1 finge...
NSS 3.24 release notes
tm/src/ new in nss 3.24 nss 3.24 includes two nss softoken updates, a new function to configure ssl/tls server sockets, and two functions to improve the use of temporary arenas. new functionality nss softoken has been updated with the latest national institute of standards and technology (nist) guidance (as of 2015): software integrity checks and post functions are executed on shared library load. these checks have been disabled by default, as they can cause a performance regression. to enable these checks, you must define symbol nss_force_fips when building nss. counter mode and galois/counter mode (gcm) have checks to prevent counter overflow. additional csps are zeroed in the code. nss softoken uses new guidance for how many rabin-miller tests are needed to verify a prime...
...type function, as it reports a misleading value for certificates that might be used for signing rather than key exchange. update sslauthtype to define a larger number of authentication key types. deprecate the member attribute authalgorithm of type sslciphersuiteinfo. instead, applications should use the newly added attribute authtype. rename ssl_auth_rsa to ssl_auth_rsa_decrypt. add a shared library (libfreeblpriv3) on linux platforms that define freebl_lowhash. remove most code related to ssl v2, including the ability to actively send a sslv2-compatible client hello. however, the server-side implementation of the ssl/tls protocol still supports processing of received v2-compatible client hello messages. disable (by default) nss support in optimized builds for logging ssl/tls key material ...
NSS 3.40 release notes
mozilla::pkix apis are not exposed in the libraries nss builds. it is easier to build nss on windows in mozilla-build environments. the following ca certificates were removed: cn = visa ecommerce root sha-256 fingerprint: 69fac9bd55fb0ac78d53bbee5cf1d597989fd0aaab20a25151bdf1733ee7d122 ...
...ce tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_40_rtm/src/ new in nss 3.40 new functionality the draft-00 version of encrypted sni support is implemented tstclnt now takes -n option to specify encrypted sni key new functions none notable changes in nss 3.40 the mozilla::pkix library has been ported from mozilla psm to nss. this is a c++ library for building certification paths. mozilla::pkix apis are not exposed in the libraries nss builds. it is easier to build nss on windows in mozilla-build environments. the following ca certificates were removed: cn = visa ecommerce root sha-256 fingerprint: 69fac9bd55fb0ac78d53bbee5cf1d597989fd0aaab20a25151bdf1733ee7d122 bugs fixed in nss 3.40 bug 1478698 - ffdhe k...
NSS 3.44 release notes
download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_44_rtm/src/ other releases are available in nss releases. new in nss 3.44 new functionality new functions in lib/certdb/cert.h cert_getcertificateder - access the der-encoded form of a certcertificate. notable changes in nss 3.44 it is now possible to build nss as a static library (bug 1543545) initial support for building for ios. bugs fixed in nss 3.44 1501542 - implement checkarmsupport for android 1531244 - use __builtin_bswap64 in crypto_primitives.h 1533216 - cert_decodecertpackage() crash with netscape certificate sequences 1533616 - sdb_getattributevaluenolock should make at most one sql query, rather than one for each attribute 1531236 - provide accessor...
...tion 1521578 - x25519 support in pk11pars.c 1540205 - freebl build fails with -dnss_disable_chachapoly 1532312 - post-handshake auth doesn't interoperate with openssl 1542741 - certutil -f crashes with segmentation fault 1546925 - allow preceding text in try comment 1534468 - expose chacha20 primitive 1418944 - quote cc/cxx variables passed to nspr 1543545 - allow to build nss as a static library 1487597 - early data that arrives before the handshake completes can be read afterwards 1548398 - freebl_gtest not building on linux/mac 1548722 - fix some coverity warnings 1540652 - softoken/sdb.c: logically dead code 1549413 - android log lib is not included in build 1537927 - ipsec usage is too restrictive for existing deployments 1549608 - signature fails with dbm disabled 1549848 - ...
PKCS11 FAQ
Mozilla › Projects › NSS › PKCS11 › FAQ
neral, you not should use different slots unless you have a good reason. much of nss's token selection is based on where the key involved is currently stored. if the token that has your private keys doesn't also do symmetric operations, for example, it's likely that the internal token will end up doing the symmetric operations. is the pkcs #11 module supplied with nss accessible through a shared library? yes, the token is call softokn3 (softokn3.dll on windows, libsoftokn3.so on most unix platforms). the nss softokn3 is not a complete pkcs #11 module, it was implemented only to support nss, though other products have managed to get it to work in their environment. there are a number of bugs against softoken's non-compliance, but these bugs have lower priority than fixing nss's non-complient use...
...rivate key database to use it? while certificates may be read into the temporary database, private keys are never extracted from the pkcs #11 module unless the user is trying to back up the key. nss represents each private key and a pointer to its pkcs #11 slot as a ck_object_handle. when nss needs to do anything with a private key, it calls the pcks #11 module that holds the key. if a pkcs #11 library reports that, for example, it does not support rsa signing operations, does nss expect to be able to pull an rsa private key off the token using the c_getattributevalue call and then do the operation in software? no. nss will never try to pull private keys out of tokens (except as wrapped objects for pkcs #12). operations the token does not support are considered impossible for the key to suppor...
PKCS11 Implement
this note will be removed once the document is updated for the current version of nss. this document supplements the information in pkcs #11: cryptographic token interface standard, version 2.0 with guidelines for implementors of cryptographic modules who want their products to work with mozilla client software: how nss calls pkcs #11 functions. function-specific information organized in the same categories as the pkcs #11 specification. functions for different kinds of tokens. summarizes the support nss expects from different kinds of tokens. ...
...n it loads a new module. the function list returned should include all the pkcs 2.0 function calls. if you don't implement a function, you should still provide a stub that returns ckr_function_not_supported. c_getinfo the nss calls c_getinfo on startup or when it loads a new module. the version numbers, manufacturer ids, and so on are displayed when the user views the information. the supplied library names are used as the default library names; currently, these names should not include any double quotation marks. (this is more restrictive than pkcs 2.0 and may change in future versions of nss.). slot and token management c_getslotlist the nss calls c_getslotlist on startup or when it loads a new module, requests all the module's slots, and keeps track of the list from that point on. the ...
Installation guide
our makefiles also have an "install" target, but it has a different meaning: our "install" means installing the headers, libraries, and programs in the appropriate directories under mozilla/dist. so right now you need to manually install the headers, libraries, and programs in the directories you want. if you install the libraries in a directory other than /usr/lib, you usually need to set the ld_library_path environment variable. you can avoid that by installing the libraries in a directory that is $origin/../lib, where $origin is the directory where the programs are installed. this is done here: http://lxr.mozilla.org/security/sour...platlibs.mk#53 53 ifeq ($(os_arch), linux) 54 ifeq ($(use_64), 1) 55 extra_shared_libs += -wl,-rpath,'$$origin/../lib64:$$origin/../lib' 56 else 57 extra_shared_l...
...the libraries you need to install are listed below. nspr: libnspr4.so libplds4.so libplc4.so nss: (note the use of * for libfreebl -- some platforms have multiple ones) libfreebl*3.so libfreebl*3.chk libsoftokn3.so libsoftokn3.chk libnss3.so libsmime3.so libssl3.so libnssckbi.so ...
NSS_3.12.3_release_notes.html
tools and test programs you also need to download the nspr 4.7.4 binary distributions to get the nspr 4.7.4 header files and shared libraries, which nss 3.12.3 requires. nspr 4.7.4 binary distributions are in https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.7.4/. new in nss 3.12.3 changes in behavior: in the development of nss 3.12.3, it became necessary to change some old library behaviors due to the discovery of certain vulnerabilities in the old behaviors, and to correct some errors that had limited nss's ability to interoperate with cryptographic hardware and software from other sources. most of these changes should cause no problems for nss users, but in some cases, some customers' software, hardware and/or certificates may be dependent on the old behaviors, ...
...eed_flag in secoidt.h: sec_oid_seed_cbc in sslproto.h: tls_rsa_with_seed_cbc_sha in sslt.h: ssl_calg_seed new structure for seed support: (see blapit.h) seedcontextstr seedcontext new functions in the nss shared library: cert_rfc1485_escapeandquote (see cert.h) cert_comparecerts (see cert.h) cert_registeralternateocspaiainfocallback (see ocsp.h) pk11_getsymkeyhandle (see pk11pqg.h) util_setforkstate (see secoid.h) nss_getalgorithmpolicy (see secoid.h) nss_setalgorithmpolicy (see secoid.h) for the 2 functions above see also (in secoidt.
Small Footprint
reter mode only, allowing you to remove code for classfile generation that include all the classes from <tt>org.mozilla.javascript.optimizer</tt> package. javaadapter implementing the javaadapter functionality requires the ability to generate classes on the fly. removing org.mozilla.javascript.javaadapter will disable this functionality, but rhino will otherwise run correctly. class generation library if you do not include optimizer or javaadapter, nor do you use policysecuritycontroller then you do not need rhino library for class file generation and you can remove all the classes from in org.mozilla.classfile package. regular expressions the package org.mozilla.javascript.regexp can be removed. rhino will continue to run, although it will not be able to execute any regular expression matc...
...ular expression matches. this change saves 47,984 bytes of class files. debug information debug information in rhino classes consumes about 25% of code size and if you can live without that, you can recompile rhino to remove it. smalljs.jar ant build script in rhino supports smalljar target that will generate smalljs.jar that does not include tools, optimizer, javaadapter and class generation library, regular expressions, e4x implementataion and deprecated files. to build such minimalist jar without debug information, run the following command from the top directory of rhino distribution: ant clean ant -ddebug=off -dno-regexp=true -dno-e4x=true smalljar if you omit -dno-regexp=true, then the resulting smalljs.jar will include regular expression support. similarly omitting -dno-e4x=true res...
Hacking Tips
name to put the breakpoint. let's say that the line number of this function is 4780, for instance: (gdb) b codegenerator.cpp:4780 breakpoint 1 at 0x84cade0: file /home/code/mozilla-central/js/src/ion/codegenerator.cpp, line 4780. (gdb) r starting program: /home/code/mozilla-central/js/src/32-release/js -f /home/code/jaeger.js [thread debugging using libthread_db enabled] using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [new thread 0xf7903b40 (lwp 12563)] [new thread 0xf6bdeb40 (lwp 12564)] run#0 breakpoint 1, js::ion::codegenerator::link (this=0x86badf8) at /home/code/mozilla-central/js/src/ion/codegenerator.cpp:4780 4780 { (gdb) n 4781 jscontext *cx = getioncontext()->cx; (gdb) n 4783 linker linker(masm); (gdb) n 4784 ioncode *code = linke...
...ossible. to run these benchmarks localy, you can clone arewefastyet sources and look inside the benchmarks directory to run individual benchmarks with your js shell. using the gecko profiler (browser / xpcshell) see the section dedicated to profiling with the gecko profiler. this method of profiling has the advantage of mixing the javascript stack with the c++ stack, which is useful to analyze library function issues. one tip is to start looking at a script with an inverted js stack to locate the most expensive js function, then to focus on the frame of this js function, and to remove the inverted stack and look at c++ part of this function to determine from where the cost is coming from. using the jit inspector (browser) install the jit inspector addon in your browser. this addon provides ...
How to embed the JavaScript engine
ou can download a source archive or use mercurial (hg) to pull the spidermonkey repository. on windows, do not install the spidermonkey source code under the msys root directory (which is usually c:\mozilla-build\msys). instead use something like c:\mozjs-31.2.0 compile spidermonkey using the build instructions at spidermonkey build documentation. by default this will build a spidermonkey shared library that you will link into your application in a later step. copy the code example above into a text editor and save the file as helloworld.cpp in the spidermonkey js\src directory. to get a copy of the code sample without line numbers, hover over the sample near the top until buttons appear. then click the view source button, and copy the code from the window that appears. compile the helloworld ...
... in a later step. copy the code example above into a text editor and save the file as helloworld.cpp in the spidermonkey js\src directory. to get a copy of the code sample without line numbers, hover over the sample near the top until buttons appear. then click the view source button, and copy the code from the window that appears. compile the helloworld application and link to the spidermonkey library. run the helloworld executable at the command line: ./helloworld how to call c functions from javascript say the c function is named doit and it would like at least two actual parameters when called (if the caller supplies fewer, the js engine should ensure that undefined is passed for the missing ones): #define doit_minargs 2 // [spidermonkey 24] use jsbool instead of bool. static bool...
SpiderMonkey Internals
ete things. design walk-through at heart, spidermonkey is a fast interpreter that runs an untyped bytecode and operates on values of type js::value—type-tagged values that represent the full range of javascript values. in addition to the interpreter, spidermonkey contains a just-in-time (jit) compiler, a garbage collector, code implementing the basic behavior of javascript values, a standard library implementing ecma 262-5.1 §15 with various extensions, and a few public apis. interpreter like many portable interpreters, spidermonkey's interpreter is mainly a single, tremendously long function that steps through the bytecode one instruction at a time, using a switch statement (or faster alternative, depending on the compiler) to jump to the appropriate chunk of code for the current instruc...
...sval. the atom manager consists of a hash table associating strings uniquely with scanner/parser information such as keyword type, index in script or function literal pool, etc. atoms play three roles: as literals referred to by unaligned 16-bit immediate bytecode operands, as unique string descriptors for efficient property name hashing, and as members of the root gc set for exact gc. standard library the methods for arrays, booleans, dates, functions, numbers, and strings are implemented using the js api. most are jsfastnatives. most string methods are customized to accept a primitive string as the this argument. (otherwise, spidermonkey converts primitive values to objects before invoking their methods, per ecma 262-3 §11.2.1.) error handling spidermonkey has two interdependent error-han...
JSAPI User Guide
many applications can benefit from scripting. these programs can execute javascript code from c++ using the spidermonkey api. note: the foss wiki page contains a few links to other libraries and programs that can make life easier when using spidermonkey and jsapi. ...
...ethods, such as array.push. it also makes it easy for each application to expose some of its own objects and functions to javascript code. browsers expose dom objects. your application will expose objects that are relevant for the kind of scripts you want to write. it is up to the application developer to decide what objects and methods are exposed to scripts. hello world using the spidermonkey library to build spidermonkey from source, see spidermonkey build documentation. some systems (such as debian) provide spidermonkey as a prebuilt package. build it from source instead. your program will be easier to debug. c++ code accesses spidermonkey via the jsapi, by including the header "jsapi.h". an overview of jsapi functionality follows. for more details, see the jsapi reference. the spidermo...
JS_SetICUMemoryFunctions
it must be called before js_init. ...
...ocfn allocfn, js_icureallocfn reallocfn, js_icufreefn freefn); type description allocfn js_icuallocfn an allocation function. reallocfn js_icureallocfn a reallocation function. freefn js_icufreefn a free function. description js_seticumemoryfunctions sets the allocator functions used by the icu internationalization library. it must be called before js_init. only use this function if you know what you are doing! mxr id search for js_seticumemoryfunctions. ...
Places utilities for JavaScript
eeduri - need to clarify here too, but i think for each livemark, there is an bookmark which contains an annotation storing the associated feed uri. lmanno_siteuri - need to clarify here, but i think for each livemark, there is an bookmark which contains an annotation storing the associated site uri. organizer_folder_anno - this annotation is associated with a folder that should be shown in the library's left pane. organizer_query_anno - this annotation is used by the places organizer to decide what nodes should be shown in the left pane. warning : placesutils class since firefox 3 beta 5 has been split into: placesutils: can be used in any toolkit application placesuiutils: only in firefox placesutils this is a gigantic object full of usefulness if you need to do any bookmark work ...
...r. tagsfolderid the folder that tags are stored in. unfiledbookmarksfolderid other other attributes stored in placesutils. localstore warning: local store provided access to the local-store rdf data source, which stores persisted information about the browser. its functionality has been replaced by xulstore. uritypes containertypes leftpanequeries queries that appear in the library's left pane. leftpanefolderid a single folder shown in the library's left pane. allbookmarksfolderid the id of the "all bookmarks" folder shown in the library's left pane. placesflavors generic_view_drop_types methods createfixeduri nsiuri createfixeduri(string aspec) takes in a spec and returns a valid uri based on it using the nsiurifixup service. parameters aspec a url ...
Finishing the Component
ven as a path. in this context, uris are the strings used refer to places or things on the web. this specific form of uri is called a uniform resource locator, or url. see the intro to the html 4 specification for more information about uris and urls. gecko encapsulates these identifiers into two interfaces, nsiuri and nsiurl. you can queryinterface between these two interfaces. the networking library, necko, deals only with these interfaces when handling requests. when you want to download a file using necko, for example, all you probably have is a string that represents the uri of the file. when you pass that string to necko, it creates an object that implements at least the nsiuri interface (and perhaps other interfaces as well). currently, the weblock implementation of the shouldload meth...
...oks like this: nsembedcstring scheme; contentlocation->getscheme(scheme); if (strcmp("http", scheme.get()) != 0 && strcmp("https", scheme.get()) != 0 && strcmp("ftp", scheme.get()) != 0) { // this isn't a type of uri that we deal with. *_retval = pr_true; return ns_ok; } creating nsiuri objects to create an nsiuri, use nsiioservice. nsiioservice is the part of the networking library ("necko") that's responsible for kicking off network requests, managing protocols such as http, ftp, or file, and creating nsiuris. necko offers tremendous network functionality, but all the weblock component needs is to create the nsiuri object that can be compared with the uris on the white list. use the service manager to acquire the nsiioservice. since this object is going to be used for the...
How to build a binary XPCOM component using Visual Studio
for now, you can use the included xpcom project that contains a simple xpcom component. you can use the project as a starting point and modify the component files to add your own functionality. to make the project, you start with a standard multi-thread dll project. then make the following tweaks: add "..\gecko-sdk\include" to additional include directories add "..\gecko-sdk\lib" to additional library directories add "nspr4.lib xpcom.lib xpcomglue_s.lib" to additional dependencies add "xp_win;xp_win32″ to preprocessor definitions turn off precompiled headers (just to keep it simple) use a custom build step for the xpcom idl file (spawns xpidl-build.bat to process the idl with mozilla toolset, not midl) vc++ express project: xpcom-test.zip note: the project uses xpcom_glue. it also uses...
...le, also in c++. the factory is in charge of creating instances of the implementations. let’s specify a simple interface: #include "nsisupports.idl" [scriptable, uuid(263ed1ba-5cc1-11db-9673-00e08161165f)] interface ispecialthing : nsisupports { attribute astring name; long add(in long a, in long b); }; remember to generate your own guid. the next step is to compile the idl into a type-library (*.xpt) and a c++ header file (*.h), which we can use to define our implementation object. the blank vc++ project has a bat file that will create the xpt and the h files. the command executes xpidl.exe twice, like this: {path_to_geckosdk}\bin\xpidl.exe -m header -i..\gecko-sdk\idl {your_idl_file} {path_to_geckosdk}\bin\xpidl.exe -m typelib -i..\gecko-sdk\idl {your_idl_file} the generated h file...
nsIPluginHost
ce gecko 1.9.2 void getpluginname(in nsiplugininstance ainstance, [shared] out string apluginname); native code only! nsiplugintag getplugintagforinstance(in nsiplugininstance ainstance); native code only! void getplugintags([optional] out unsigned long aplugincount, [retval, array, size_is(aplugincount)] out nsiplugintag aresults); void handlebadplugin(in prlibraryptr alibrary, in nsiplugininstance instance); native code only! void init(); native code only! void instantiatedummyjavaplugin(in nsiplugininstanceowner aowner); native code only! void instantiateembeddedplugin(in string amimetype, in nsiuri aurl, in nsiplugininstanceowner aowner); native code only! void instantiateembededplugin(in string amimetype, in nsiuri ...
...ce( in nsiplugininstance ainstance ); parameters ainstance the plugin instance object. return value plugin tag object. getplugintags() void getplugintags( out unsigned long aplugincount, optional [retval, array, size_is(aplugincount)] out nsiplugintag aresults ); parameters aplugincount optional aresults native code only!handlebadplugin void handlebadplugin( in prlibraryptr alibrary, in nsiplugininstance instance ); parameters alibrary instance native code only!init void init(); parameters none. native code only!instantiatedummyjavaplugin instantiate a "dummy" java plugin if a java plugin that supports npruntime is installed. this plugin is used for exposing window.java and window.packages. if the java plugin supports npruntime and instant...
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. ...
...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, as well as to allocate memory, get access to services, and to instantiate interfaces.foldersthe folder classes all implement the nsimsgfolder interface. there are currently three folder classes - nslocalmailfolder, nsimapmailfolder, and nsnewsfolder. they all inherit from nsmsgdbfolder, which implements a lot of the core functionality. rss feeds are implemented by nslocalmailfolder.ns ensure suc...
XSLT 2.0
although xslt 2.0 is not natively supported in firefox, it is possible via saxon-b (java) or, more recently, saxon-ce (javascript) to perform xslt 2.0. for users saxon-ce no extensions are required, saxon-ce runs whenever a html page is loaded that links to the saxon-ce javascript library. saxon-b the xsl results extension uses the new incarnation of liveconnect (handled by java 1.6v12+ instead of mozilla-specific code) to connect with the java-based saxon-b library, and adds support for having xslt performed automatically when visiting a page with the appropriate xslt processing instruction (and which isn't processed by firefox's own xslt 1.0 processor). for developers saxon-ce a javascript api is provided for initiating an xslt 2.0 transform from a web page. error and diagnost...
...ing instruction (and which isn't processed by firefox's own xslt 1.0 processor). for developers saxon-ce a javascript api is provided for initiating an xslt 2.0 transform from a web page. error and diagnostics output from saxon-ce can be reviewed in the firefox developer console or in firebug. saxon-b the extension demonstrates how one can use liveconnect code to communicate with the saxon-b library, but one might find the javascript code module approach used inside the extension xquseme as a more reusable approach. the code does not currently work on the mac (except for server edition supporting java 1.6) due to its lagging java support (and thus liveconnect support). ...
ABI
64/amd64 architectures. a calling convention is an implementation-level (low-level) scheme regarding how subroutines receive parameters from their caller and how they revert. http://en.wikipedia.org/wiki/x86_calling_conventions abi abi stands for "application binary interface". http://en.wikipedia.org/wiki/application_binary_interface os specific windows https://msdn.microsoft.com/en-us/library/k2b2ssfy.aspx https://msdn.microsoft.com/en-us/library/9b372w95.aspx details with respect to js-ctypes this explains how to use it in the js-ctypes scope. three different abis exist: ctypes.default_abi, ctypes.stdcall_abi, and ctypes.winapi_abi. ctypes.default_abi corresponds to cdecl; standard libraries use this abi. you can also use this for various system calls,including those on mac os...
...w string tosource() string tostring() methods tosource() returns the string "ctypes.***_abi". string tosource() parameters none. return value a javascript expression that evaluates to the abi. tostring() returns a string identifying the abi. string tostring(); parameters none. return value a string identifying the abi. see also ctypes functiontype library ...
js-ctypes reference
of the ctypes api. it is obtained by by loading the ctypes module: components.utils.import("resource://gre/modules/ctypes.jsm"); you can use the ctypes object to load libraries, construct types, and perform miscellaneous tasks such as type casting. the ctypes object also provides numerous predefined types that correspond to primitives and common typedefs in c. working with libraries to load a library, use ctypes.open(). the library object is used mostly to declare native functions provided by the library so that js-ctypes knows how to call them. see library.declare() for instructions on how to declare these functions. once you have finished working with a library, call library.close(). calling conventions see abi. types and data to use js-ctypes effectively, it is important to understan...
... is important to understand the different kinds of objects that the module provides. there are three major categories: types these represent a type in c, and are thus represented by ctype objects. these objects have two main purposes. first, they provide a concrete representation of different data types, allowing the programmer to describe the arguments and return type of a native function (see library.declare()). second, they serve as constructors to create concrete instances of the given type, i.e. cdata objects. out of the box, js-ctypes supports a number of predefined types. type constructors these are functions that define new types, and thus return a ctype object. these include ctypes.pointertype(type) and the .ptr property, which creates a new type describing a pointer to an exist...
js-ctypes
working with data working with arraybuffers declaring types declaring and calling functions declaring and using callbacks type conversion memory management chromeworker js-ctypes reference a reference guide to the js-ctypes api. abi cdata ctype ctypes functiontype int64 library uint64 view all... examples add to iphoto a firefox extension that uses js-ctypes to call carbon and core foundation framework routines on mac os x to implement an "add image to iphoto" feature in firefox. using c structs and pointers using com from js-ctypes using objective-c from js-ctypes github :: ocha...
... view all... examples add to iphoto a firefox extension that uses js-ctypes to call carbon and core foundation framework routines on mac os x to implement an "add image to iphoto" feature in firefox. using c structs and pointers using com from js-ctypes using objective-c from js-ctypes github :: ochameau / jscpptypes a mangling library to use c++ from js-ctypes community view mozilla forums... mailing list newsgroup rss feed stackoverflow - jsctypes related topics xpcom in gecko 2 - binary components ...
Initialization and Destruction - Plugins
when the browser encounters data of a mime type registered for a plug-in (either embedded in an html page or in a separate file), it loads the plug-in code into memory (if it hasn't been loaded already) and creates a new instance of the plug-in. for more information, see registering plug-ins. plug-ins are native code libraries: .dll files on windows, .so or .dso files on unix, and powerpc shared library files or 68k code resources on mac os. to reduce memory overhead, plug-ins are usually loaded only when needed and released as soon as possible. in the initialization process, the browser passes the plug-in two tables of function pointers for all api calls: one table lists all api calls from the plug-in to the browser. this table is filled out by the browser before the initialization call. t...
...on, since the browser can delete the saved data with the equivalent of npn_memalloc at any time. shutdown when the application no longer needs the plug-in, it is shut down and released. np_shutdown gives you an opportunity to delete data allocated in np_initialize to be shared by all instances of a plug-in. the browser calls the plug-in's np_shutdown function, which informs the plug-in that its library is about to be unloaded, and gives it a chance to cancel any outstanding i/o requests, delete threads it created, free any memory it allocated, and perform any other closing tasks. the np_shutdown function releases memory or resources shared across all instances of a plug-in. it is called once after the last instance of the plug-in is destroyed, before releasing the plug-in library itself. void...
Deprecated tools - Firefox Developer Tools
...
...ne and edit the source of the webgl vertex and fragment shaders. it was deprecated due to low usage and maintenance costs. more details about the shader editor alternatives an alternative to this panel is this extension: https://github.com/spite/shadereditorextension, or spector.js also supports a shader editor that requires a library to use a shader reloader hook. currently only the babylon library does. ...
Console messages - Firefox Developer Tools
43, but removed in firefox 56. you can install the chrome logger extension to (re)-enable the feature. with the chrome logger extension, web console can display messages sent from the server. this enables you to use the web console to debug server-side code. it uses the chrome logger protocol. briefly, the way it works is: your server-side code — python, php, node.js, etc. ...
...th the chrome logger extension, web console can display messages sent from the server. this enables you to use the web console to debug server-side code. it uses the chrome logger protocol. briefly, the way it works is: your server-side code — python, php, node.js, etc. — includes a library that provides a console api. your server-side code uses this api to log messages. the server-side library creates json objects from the messages and encodes them for transmission. the messages are transmitted to the client as a response header named x-chromelogger-data. the web console decodes these headers and displays them. to find a suitable library for your server code, see the chrome logger documentation. interpreter input/output commands sent to the browser using the web console's javascr...
Canvas API - Web APIs
canvas api. demo: a basic ray-caster a demo of ray-tracing animation using canvas. manipulating video using canvas combining <video> and <canvas> to manipulate video data in real time. libraries the canvas api is extremely powerful, but not always simple to use. the libraries listed below can make the creation of canvas-based projects faster and easier. easeljs is an open-source canvas library that makes creating games, generative art, and other highly graphical experiences easy. fabric.js is an open-source canvas library with svg parsing capabilities. heatmap.js is an open-source library for creating canvas-based data heat maps. javascript infovis toolkit creates interactive data visualizations. konva.js is a 2d canvas library for desktop and mobile applications. p5.js has a full...
...e applications. p5.js has a full set of canvas drawing functionality for artists, designers, educators, and beginners. paper.js is an open-source vector graphics scripting framework that runs on top of the html5 canvas. phaser is a fast, free and fun open source framework for canvas and webgl powered browser games. processing.js is a port of the processing visualization language. pts.js is a library for creative coding and visualization in canvas and svg. rekapi is an animation key-framing api for canvas. scrawl-canvas is an open-source javascript library for creating and manipulating 2d canvas elements. the zim framework provides conveniences, components, and controls for coding creativity on the canvas — includes accessibility and hundreds of colorful tutorials. note: see the webgl...
RTCDataChannel.onerror - Web APIs
l call to handle the error event when it occurs on the data channel. this function receives as its only input an errorevent object describing the event which was received. that event object, in turn, describes the error that took place. example in the example below, a data channel is established, and an onerror handler is added to it. ...
...in turn, describes the error that took place. example in the example below, a data channel is established, and an onerror handler is added to it. the error handler passes information about the error to a ui library's alert box function to present an error message to the user. let pc = new rtcpeerconnection(); let dc = pc.createdatachannel("playercontrol"); dc.onerror = function(event) { myuilibrary.doalertbox({ 'network error', // alert title 'the error "' + event.message + '" occurred while handling player control network messages.', event.filename, event.lineno, event.colno }); } /* ... */ specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.
Adding 2D content to a WebGL context - Web APIs
« previousnext » once you've successfully created a webgl context, you can start rendering into it. a simple thing we can do is draw a simple square untextured plane, so let's start there, by building code to draw a square plane. the complete source code for this project is available on github. this project uses the glmatrix library to perform its matrix operations, so you will need to include that in your project. we're loading a copy from a cdn in our html's <head>. drawing the scene the most important thing to understand before we get started is that even though we're only rendering a square plane object in this example, we're still drawing in 3d space. it's just we're drawing a square and we're putting it directly in front of the camera perpendicular to the view direc...
... to the attribute the shader is using for avertexposition and we tell webgl how to pull the data out of it. finally we draw the object by calling the drawarrays() method. view the complete code | open this demo on a new page matrix utility operations matrix operations might seem complicated but they are actually pretty simple if you take them one step at a time. generally people use a matrix library rather than writing their own. in our case we're using the popular glmatrix library. see also matrices on webglfundamentals matrices on wolfram mathworld matrix on wikipedia « previousnext » ...
Writing WebSocket servers - Web APIs
it doesn't get the subprotocol it wants. if you want your server to obey certain subprotocols, then naturally you'll need extra code on the server. let's imagine we're using a subprotocol json. in this subprotocol, all data is passed as json. if the client solicits this protocol and the server wants to use it, the server needs to have a json parser. practically speaking, this will be part of a library, but the server needs to pass the data around. tip: to avoid name conflict, it's recommended to make your subprotocol name part of a domain string. if you are building a custom chat app that uses a proprietary format exclusive to example inc., then you might use this: sec-websocket-protocol: chat.example.com. note that this isn't required, it's just an optional convention, and you can use any s...
... tip: to avoid name conflict, it's recommended to make your subprotocol name part of a domain string. ...
The WebSocket API (WebSockets) - Web APIs
data on the connection. closeevent the event sent by the websocket object when the connection closes. messageevent the event sent by the websocket object when a message is received from the server. guides writing websocket client applications writing websocket servers writing a websocket server in c# writing a websocket server in java tools humblenet: a cross-platform networking library that works in the browser. it consists of a c wrapper around websockets and webrtc that abstracts away cross-browser differences, facilitating the creation of multi-user networking functionality for games and other apps. µwebsockets: highly scalable websocket server and client implementation for c++11 and node.js. clusterws: lightweight, fast and powerful framework for building scalable webso...
...s) and eventsource (one-way connections) for node.js server and client. signalr: signalr will use websockets under the covers when it's available, and gracefully fallback to other techniques and technologies when it isn't, while your application code stays the same. caddy: a web server capable of proxying arbitrary commands (stdin/stdout) as a websocket. ws: a popular websocket client & server library for node.js. jsonrpc-bidirectional: asynchronous rpc which, on a single connection, may have functions exported on the server and, and the same time, on the client (client may call server, server may also call client). cowboy: cowboy is a small, fast and modern http server for erlang/otp with websocket support. related topics ajax javascript specifications specification sta...
Movement, orientation, and motion: A WebXR example - Web APIs
. contrarily, when rendering the right eye, the viewport is set to restrict drawing to the right half of the surface. this example demonstrates this by showing the canvas on the screen, even when presenting a scene as an immersive display using an xr device. dependencies while we will not rely upon any 3d graphics frameworks such as three.js or the like for this example, we do use the glmatrix library for matrix math, which we've used in other examples in the past. this example also imports the webxr polyfill maintained by the immersive web working group, which is the team responsible for the webxr api's specification. by importing this polyfill, we allow the example to work on many browsers that don't yet have webxr implementations in place, and we smooth out any transient deviations from the...
...e session to the webgl layer so it konws what to use as a rendering surface by calling xrsession.updaterenderstate() with a baselayer set to a new xrwebgllayer. we then look at the value of the session_type constant to see whether the webxr context should be immersive or inline. immersive sessions use the local reference space, while inline sessions use the viewer reference space. the glmatrix library's fromtranslation() function for 4x4 matrices is used to convert the viewer's start position as given in the viewerstartposition constant into a transform matrix. the viewer's starting orientation, viewerstartorientation, is copied into the cubeorientation property, which will be used to track the rotation of the cube over time. sessionstarted() finishes up by calling the session's requestrefere...
Writing Web Audio API code that works in every browser - Developer guides
we don't want to maintain two or more separate code bases, and feature detection code is cumbersome! plus we want to write code that reliably works in the future, or at least, works with a minimum amount of changes. is there a way to satisfy all these constraints at the same time? probably! writing for today (and tomorrow) first, get a copy of audiocontext-monkeypatch by chris wilson. this little library will "normalise" the interfaces for you and make it look as if your code is running in a standards compliant browser, by aliasing prefixed names to the unprefixed versions. and it won't do anything if the unprefixed versions are already present. once you include it in your page, you can write in "modern web audio api" style, and do things such as: var audiocontext = new audiocontext(); everywher...
...ames to the unprefixed versions. and it won't do anything if the unprefixed versions are already present. once you include it in your page, you can write in "modern web audio api" style, and do things such as: var audiocontext = new audiocontext(); everywhere, including chrome/ium, opera, safari, and ---of course!--- firefox. also, if new methods such as start are not detected in some nodes, the library will also alias them to their old names. thus, start is mapped to noteon, stop to noteoff, and so on. if you're porting moderately "old" code (say, a year old) it's possible that it uses some methods that audiocontext-monkeypatch doesn't alias, because it helps you to write code in the new style. for example, the way to create instances of gainnode used to be var gain = audiocontext.creategainnod...
Mobile first - Progressive web apps (PWAs)
ally it is much better to use a dedicated existing solution, such as modernizr. modernizr is a good choice as it not only includes a feature detect for just about everything (css, html5, some other bits besides), it is also fairly reliable, and you can create your own custom version with only the feature detects you need in it, using the modernizr download builder. the full uncompressed modernizr library is 42kb, but the version we are using in this demo is only 8kb. i put modernizr inside my js/lib directory, then included it by putting the following construct inside my html file: <script type="text/javascript" src="js/lib/modernizr.js"></script> with modernizr in place, we can now use the following js block to test whether media queries are supported, and if not, to load in respond.js, scott...
...ted, and if not, to load in respond.js, scott jehl's matchmedia and media query polyfill. if(!modernizr.mq('only all')) { require('respond'); } editorial note: this currently doesn't work, and i'm not sure why. ongoing work required. matchmedia is also very useful in many other ways. imagine you wanted to include some kind of webgl chart in the desktop version of the site requiring a webgl library like three but didn't want it included in the mobile version? you could create a block to only load the library in the case of narrow screen devices: if(window.matchmedia("(min-width: 481px)").matches) { require('three'); } we can, therefore, save the bandwidth for browsers that don't need it. modernizr css and js back to modernizr! the reason why it is so useful is that it provides a mecha...
WebAssembly Concepts - WebAssembly
javascript glue code is not as simple as you might imagine. for a start, emscripten implements popular c/c++ libraries like sdl, opengl, openal, and parts of posix. these libraries are implemented in terms of web apis and thus each one requires some javascript glue code to connect webassembly to the underlying web api. so part of the glue code is implementing the functionality of each respective library used by the c/c++ code. the glue code also contains the logic for calling the above-mentioned webassembly javascript apis to fetch, load and run the .wasm file. the generated html document loads the javascript glue file and writes stdout to a <textarea>. if the application uses opengl, the html also contains a <canvas> element that is used as the rendering target. it’s very easy to modify the ...
......
Loading Content Scripts - Archive of obsolete content
iple scripts, which can also interact directly with each other in the content process: // "data" is supplied by the "self" module var data = require("sdk/self").data; ... contentscriptfile: [data.url("jquery-1.4.2.min.js"), data.url("my-content-script.js")] scripts specified using contentscriptfile are loaded before those specified using contentscript. this enables you to load a javascript library like jquery by url, then pass in a simple script inline that can use jquery. unless your content script is extremely simple and consists only of a static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo. instead, keep the script in a separate file and load it using contentscriptfile. this makes your code easier to maintain, secure, debug and...
Reddit Example - Archive of obsolete content
finally, it registers a listener to the user-defined click event which in turn passes the url into the open function of the tabs module. this is the panel.js content script that intercepts link clicks: $(window).click(function (event) { var t = event.target; // don't intercept the click if it isn't on a link. if (t.nodename != "a") return;...
XUL Migration Guide - Archive of obsolete content
ges, making it easier to review and secure the code. security implications we saw above that using powerful low-level modules like tab-browser increases the damage that a malicious web page could do if it were able to inject code into your add-ons context. this applies with even greater force to require("chrome"), since this gives full access to the browser's capabilities. example: porting the library detector porting the library detector walks through the process of porting a xul-based add-on to the sdk. it's a very simple add-on and a good candidate for porting because there are suitable sdk apis for all its features. even so, we have to change its user interface slightly if we are to use only the supported apis. ...
dev/panel - Archive of obsolete content
ntent.textcontent = json.stringify(event.data); } debuggee.postmessage({ "to":"root", "type":"listtabs" }); }); if you do this, don't forget to call start() on the port before passing it over to the panel document. volcan.js: a javascript api for the debugging protocol communicating with the debugger server by exchanging json messages can be cumbersome. so we've also provided a library called volcan.js which gives you a javascript api to the remote debugging protocol. note that at the moment volcan.js does not support the complete remote debugging protocol. we're still working on documenting exactly which messages are supported by volcan.js. to use volcan.js, you can just include it from your panel's html like this: <html> <head> <meta charset="utf-8"> <link href...
Forms related code snippets - Archive of obsolete content
rtially supported in opera 9+ and safari. it is not supported in internet explorer 6-9, or in the preview of internet explorer 10. const is going to be defined by ecmascript 6, but with different semantics. similar to variables declared with the let statement, constants declared with const will be block-scoped. we used it only for didactic purpose. if you want a full browser compatibility of this library, please replace all the const statements with the var statements. this date-picker code snippet will automatically create an html code like the following: <table id="zdp-cal-1" class="zdp-calendar" style="z-index: 1026; position: absolute; left: 294px; top: 47px;"> <caption><span id="zdp-decr-year-1" class="zdp-decrease-year">&laquo;</span><span id="zdp-decr-month-1" class="zdp-decrease-mont...
Rosetta - Archive of obsolete content
ode is nothing but the base for an extensible collection of compilers. but by default, no compilers are loaded. it relies on the fact that unrecognized mime types will be simply ignored: this allows us to manually parse them. for a fast overview on the code proposed here you can git clone https://github.com/madmurphy/rosetta.js, or, at your choice, directly download this .zip file. rosetta.js: library "use strict"; /*\ |*| |*| :: rosetta.js :: |*| |*| a possible, extensible collection of compilers to native ecmascript. |*| |*| november 12, 2014 |*| |*| https://developer.mozilla.org/add-ons/code_snippets/rosetta |*| https://developer.mozilla.org/user:fusionchess |*| |*| this framework is released under the gnu public license, version 3 or later. |*| http://www.gnu.org/licenses/gpl-3.0...
JavaScript Daemons Management - Archive of obsolete content
erval = function (vcallback, ndelay) { var aargs = array.prototype.slice.call(arguments, 2); return __nativesi__(vcallback instanceof function ? function () { vcallback.apply(null, aargs); } : vcallback, ndelay); }; window.setinterval.ispolyfill = true; } */ daemon-safe.js what follows is the module which extends the daemon constructor with a daemon.safe sub-system. this library requires daemon.js to work. the daemon.safe constructor is a dependent-clone of daemon which uses a recursive invocation of the settimeout timer rather than a single invocation of setinterval. /*\ |*| |*| ******************************* |*| * daemon-safe.js * |*| ******************************* |*| |*| ver. 1.0 rev. 2 |*| |*| daemon.js - a javascript highly scalab...
Code snippets - Archive of obsolete content
to run other applications <canvas> related what wg canvas-related code signing a xpi how to sign an xpi with pki delayed execution performing background operations. miscellaneous miscellaneous useful code fragments html to dom using a hidden browser element to parse html to a window's dom javascript libraries here are some javascript libraries that may come in handy. stringview a library that implements a stringview view for javascript typed arrays. this lets you access data in typed arrays using c-like string functions. rosetta by default, the only possible standardized scripting language for html is ecmascript. hence, if you are going to use another scripting language you might expect that most of the browsers will not recognize it. nevertheless, the increasing computational ...
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
user profile will vary depending on your system. on windows vista, it will be located at c:\users\username\appdata\roaming\mozilla\firefox\profiles\random number.default\ ; on windows xp or 2000, it will be c:\documents and settings\username\application data\mozilla\firefox\profiles\random number.default\ ; on linux, it will be ~/.mozilla/firefox/random number.default/ ; on mac os x, it will be ~/library/application support/firefox/profiles/random number.default/ in the interests of security, delete these lines from prefs.js after finishing these tests. note that 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 met...
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
let extension = extensions.get(your_extension_id); if (extension.firstrun) { // add button here. } }) both function firstrun(extensions) { let extension = extensions.get(your_extension_id); if (extension.firstrun) { // add button here. } } if (application.extensions) firstrun(application.extensions); else application.getextensions(firstrun); the fuel library currently only works on firefox 3 and above. « previousnext » this tutorial was kindly donated to mozilla by appcoast. ...
Appendix F: Monitoring DOM changes - Archive of obsolete content
o work under most circumstances. css animation events this technique, which works on firefox 5+, has some particular advantages. because it is based on css, it can be keyed to match new elements of any arbitrary css selector. and because it is css-based, and is triggered when css is being applied anyway, it does not slow dom mutations. the technique was adapted from the method used by the x-tag library. the code below contains an inefficient fallback implementation for older browsers. it is worth noting, however, that while the animation-based implementation will fire any time an element which previously did not match the given selector is changed so that it does (when a class is added, for instance), the fallback will only match nodes when they are inserted into the dom tree. minor changes ar...
Introduction - Archive of obsolete content
read terms like "xul applications" and "xul extensions", but rarely will they refer to projects that are exclusively built with xul. it usually means that the projects were built using mozilla technologies. even this project, called xul school, covers several other technologies such as javascript, css, xbl and xpcom. xulrunner xulrunner includes the gecko rendering engine, the necko networking library, and several other components that provide os-independent file management, accessibility, and localization, among others. it is this very powerful platform that has allowed such a fast growth of the development community surrounding mozilla and firefox. xulrunner is available in binary form at the xulrunner page, and it is the base for several projects, such as songbird, miro and eudora. there's...
Local Storage - Archive of obsolete content
the previous data will be recovered. this is the default behavior when firefox is uninstalled: the profile information remains intact and it will be there waiting for you if firefox is installed again. others feel concerned about privacy and storing private information locally without deleting it. a good argument can be done for both, so it is up to you to choose what to do in this case. the fuel library has an uninstall event you can use to perform these operations. logging good logging is essential in all kinds of software projects. any extension that is more complex than a hello world needs some way to log errors and trace execution without having to fire up a debugger. it used to be the case that custom logging solutions were necessary, but mozilla labs have come up with a javascript imple...
Search Extension Tutorial (Draft) - Archive of obsolete content
choice will result in stronger action, such as blacklisting of the add-ons in question. the most technically sound method of achieving this, and the only acceptable way of changing preferences such that they are automatically restored on add-on uninstall, is to make such changes in the default preference branch, as explained below. while the technical details below are important to understand, a library which encapsulates the appropriate logic is provided along with the example add-on at the end, and should be used where possible. changing default preference values there are two common ways of changing default preference values. the simplest, which works only for traditional, non-restartless add-ons, is to add the preference changes to a file in an extension's defaults/preferences/ directory. th...
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
//note: for accessing the active directory of windows server later than 2000 //it is necessary to allow anonymous read access. please see //(german) http://interop.blog.de/2010/02/13/kapitel-1-ldap-anfragen-linux-ad-8001564/ //or search the net how to do it. ...
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
n. this is how webpages invoke your plugin. should either be like "application/x-vnd-yourorganization-yourfiletype" or be officially registered with iana (unlikely) or be a standard type (e.g. if you want to play mpeg files). file extension reflects the data type handled by the plugin, esp. when loaded from local disk on windows. build create a new project in visual studio for a win32 gui library (dll) (in .net 2003: win32 template, then switch to dll in application settings in the following dialog, export symbols too?)(in visual studio 2008, it is visualc++|win32|win32 project, then check dll in the wizard). if a wizard gives you a checkbox to create an empty project, then check it. otherwise you'll delete files later. again note that the resulting dll filename must start with "np", so...
Creating a Mozilla Extension - Archive of obsolete content
ly and passing tests). the extension will access tinderbox, mozilla.org's webtool for tracking source code status, to get the status of the code. completing this tutorial will give you a basic understanding of how mozilla's user interface (ui) is constructed, how to find the source code for the ui you want to extend, how to make an installation of mozilla modifiable, how to use mozilla's network library to load and parse web pages in javascript, and how to use dynamic overlays to package a mozilla extension for installation by others. contents prerequisites tinderbox making a mozilla installation modifiable finding the file to modify finding the code to modify adding the structure specifying the appearance enabling the behavior - retrieving tinderbox status enabling the behavior - up...
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
the mozilla source tree. xulrunner ships with the javaxpcom component, which allows java code to interact with xpcom objects. as you will see in this article, working with xpcom objects in java is not that much different than doing so in c++. prerequisites java 1.4.2 or newer xulrunner 1.8.0.1 or newer embedding in order to embed mozilla in your java application, you will need to add the library mozillainterfaces.jar (located in xulrunner/sdk/lib folder) to your classpath. this library provides the interfaces necessary to bootstrap mozilla and call xpcom methods. to start embedding, we use the methods provided by the mozilla singleton class. first, the java application must find a suitable xulrunner installation: mozilla mozilla = mozilla.getinstance(); greversionrange[] range = new ...
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
n related to a particular load. there is basically one of these per load (though see the section on stream converters). nsdocumentopeninfo implements nsistreamlistener and proxies the nsistreamlistener calls over to the "real" stream listener once one is chosen. this is the class that handles deciding where the data from the load should go. supporting roles necko this is the mozilla networking library. this handles actually going out and getting the data. it also handles determining the mime type of the data, which is used to decide who gets the data. category manager this is used in a last-ditch attempt to find a content listener. nsiuricontentlistener implementations we try to find one of these which can handle data of the type we're looking at (that is, it can give us an nsistreamlistener t...
GRE Registration - Archive of obsolete content
are/mozilla.org/gre/<version>. when installing a gre via the command line <tt>xulrunner.exe -register-global</tt>, xulrunner will detect that there is already an installation at hklm/software/mozilla.org/gre/<version> and will try alternate keys <version>_1 _2 until an available key is found. mac on mac, the only gre is the libxul framework xul.framework. this framework is installed either in /library/frameworks/xul.framework/versions/<version> or in ~/library/frameworks/xul.framework/versions/<version>. linux on linux, registration information is kept in ini-style files of the following form: [1.7.10] gre_path=/usr/lib/mozilla-1.7.10 feature=value feature2=value2 these ini files can be in any of the following locations: /etc/gre.conf /etc/gre.d/*.conf ~/.gre.conf ~/.gre.d/*.conf mozilla ...
Extenders - Archive of obsolete content
ack prototype, which is no longer under active development. ...
Metro browser chrome tests - Archive of obsolete content
mework for defining and running tests. a simple test looks like this: gtests.push({ desc: "test loading about:blank", setup: function () { }, teardown: function () { }, run: function () { yield addtab("about:blank"); is(tab.browser.currenturi.spec, "about:blank", "about:blank is loaded"); } }); function test() { runtests(); } gtests contains individual tests that make up the library of tests your test file will contain. each test can have start up and tear down logic, plus the body of the test contained in run(). the test file can contain other functions which will be ignored unless invoked by test(). gtests make use of promises and tasks for managing execution. test comparison functions used in metro browser chrome tests are identical to those supported by mochitests, see h...
Mozilla Application Framework - Archive of obsolete content
rn xml language for defining ui structure, a schema for localization, and support for both native and cross-platform (using css) look and feel to make writing uis quick and painless. gecko a performant web content rendering/editing engine with world-leading support for standards that you can drop into your application with a single line of xul. necko a wicked-fast, extensible networking library with built-in support for many common protocols and a well-defined plug-in interface for custom protocol handling so you can add the protocols you need. xpcom a simple, cross-platform component model with multiple language bindings and idl descriptions so you can plug your custom functionality into the framework and connect it with other components. web services built-in support for xml...
Porting NSPR to Unix Platforms - Archive of obsolete content
take you extra time. therefore i write this article to document the more mechanical part of the unix porting task. for certain more "standard" unix platforms, this may be all you have to do. on other platforms, you may need to do extra work to deal with their idiosyncrasies. porting instructions you can use different threading packages to implement nspr threads. nspr has a user-level threading library where thread context switches are done by <tt>setjmp/longjmp</tt> or <tt>sigsetjmp/siglongjmp</tt>. this is called the local threads only version of classic nspr. you should attempt to do a local threads only port first. the classic nspr source files are in <tt>mozilla/nsprpub/pr/src/threads</tt> and <tt>mozilla/nsprpub/pr/src/io</tt>. if the platform has pthreads, you can also use pthreads as an...
Bundles - Archive of obsolete content
hold additional resources currently limited to: application ini settings application icon script for the application chrome, not the web content installing a bundle when prism opens a webapp bundle it will unpack it into the webapps/{webapp-id} folder. this folder is located in the application data folder of the user's home directory on windows, in the ~/.webapps directory on linux and under ~/library on os x. since this folder maybe be located in a directory that requires elevated privileges, the web application should not write data to it. the application profile directory can be used instead for this purpose. note: the webapp must have an id in order to be installed. when prism is launched with a "-webapp [bundle]" command line, the bundle must first be unpacked before the web application i...
Prism - Archive of obsolete content
browser window for running web applications. using configuration files and webapp scripting, the host window can be modified. installer installing prism. view all... ...
SpiderMonkey coding conventions - Archive of obsolete content
use the spidermonkey c++ coding style page on wikimo which is more up to date and the canonical source. the spidermonkey project owners enforce coding conventions pretty strictly during code reviews. naming conventions public function names begin with js_ followed by capitalized "intercaps", e.g. js_newobject. extern but library-private function names use a js_ prefix and mixed case, e.g. js_searchscope. most static function names have unprefixed, mixed-case names: getchar. but static native methods of js objects have lowercase, underscore-separated or intercaps names, e.g., str_indexof. and library-private and static data use underscores, not intercaps (but library-private data do use a js_ prefix). scalar type names are lowercase and js-prefixed: jsdouble. aggreg...
Actionscript Acceptance Tests - Archive of obsolete content
estname.as.avm_args files will take precedence over the dir.avm_args file testname.as.tz if a test is only valid for certain timezones, the timezones can be specified in this support file. below is a sample file that covers the 4 main us timezones: # place all timezones that this file applies to. # these values correspond to the value returned by time.tzname tuple. # (see http://docs.python.org/library/time.html for details) # e.g.: eastern standard time/eastern daylight time = ('est','edt') # write timezones as tuples, one to each line. ('est', 'edt') ('cst', 'cdt') ('mst', 'mdt') ('pst', 'pdt') testname.err this file is used when the test throws an uncatchable error. the first line must contain the expected error (without the extra debugger information). the exitcode is optional, but must b...
Tamarin build documentation - Archive of obsolete content
no such file: no such file or directory collect2: ld returned 1 exit status make[2]: *** [link_app.] error 1 make[1]: *** [openssl] error 2 make: *** [build_apps] error 1 you can ignore these errors. the necessary static files 'libcrypto.a' and 'libssl.a' are made correctly and are present in the /openssl folder. more information on why this happens on mac os is here: http://developer.apple.com/library/mac/#qa/qa2001/qa1118.html - create a /frameworks/base/opengl/include/egl folder under your sdk/ndk top folder. get the ersion 1.4 egl header files (egl.h, eglext.h and eglplatform.h) from http://www.khronos.org/registry/egl/ and save or copy them there. build tamarin release shell - get tamarin-redux - export the following variables into the environment $ export android_toolchain=<full p...
The life of an HTML HTTP request - Archive of obsolete content
ll::doloadurl (called from some loadurl or loaduri variant in the webshell). the webshell then tells its documentloader to load (command "view") the specified url. [note: passes nswebshell.mobserver as nsistreamobserver and the webshell as nsicontentviewercontainer to the docloader.] (2) the document loader calls ns_openuri with the url to begin transfering the requested file. necko (the network library) checks the url scheme (the first part of the url, http: in this case) and locates the correct nsiprotocolhandler (in this case nshttphandler) and asks it for a nsichannel (nshttpchannel). the channel represents the connection to the server, and is the source of the html data stream. (3) when data is starting to come from the webserver the nsichannel calls the onstartrequest in the documenloader...
TraceVis - Archive of obsolete content
with tracevis, and run with tracevis enabled, then tracemonkey will output a log of all its activity transitions. the log can be postprocessed into a visualization that can be used to rapidly diagnose many tracing-related performance issues. so far, most of the documentation on tracevis is contained in the announcement blog post. prerequisites the visualization scripts require pil (python imaging library). building with tracevis these are the steps to build a js shell with tracevis, starting from a mozilla source directory. these directions create an optimized build, because optimized builds are usually better for performance analysis. cd js/src autoconf213 mkdir opt-tracevis cd opt-tracevis ../configure --enable-tracevis make -j2 the resulting binary will be at dist/bin/js relative to the curren...
Install Wizards (aka: Stub Installers) - Archive of obsolete content
ch resides at: < http://lxr.mozilla.org/seamonkey/sou...pinstall/stub/> this "glue" code initialized xpcom and registers the xpinstall engine and requisite components to prepare for use by the stub installer. the stub installer hands off one-by-one a series of xpis to install. what do we mean by libxpnet? cross-platform functionality for making file transfers across a network is provide by the library libxpnet. complete details about this library is available at libxpnet: architecture and api overview. original document information author(s): samir gehani other contributors: curt patrick last updated date: march 12, 2003 copyright information: copyright (c) samir gehani, curt patrick ...
Install script template - Archive of obsolete content
plid, version); if (err != 0) { // call initinstall again in case illegal characters in plid err = initinstall(software_name, software_name, version); if (err != 0) cancelinstall(err); } //addfiles to current browser block var pluginsfolder = getfolder("plugins"); //verify disk space if(verifydiskspace(pluginsfolder, plugin_size+component_size)) { // start installing plugin shared library reseterror(); // install the plugin shared library to the current browser's plugin directory errblock1 = addfile (plid, version, plugin_file, pluginsfolder, null); if (errblock1!=0) { logcomment("could not add " + plugin_file + " to " + pluginsfolder + ":" + errblock1); cancelinstall(errblock1); } // start installing xpt file if this is a scriptable plugin // install to the plugi...
Return Codes - Archive of obsolete content
rce_is_directory -233 expected source file and got directory source_is_file -234 expected source directory and got file insufficient_disk_space -235 not enough disk space for install filename_too_long -236 unable_to_locate_lib_function -237 unable_to_load_library -238 chrome_registry_error -239 malformed_install -240 key_access_denied -241 access to the registry key has been denied key_does_not_exist -242 registry key does not exist value_does_not_exist -243 registry value does not exist ...
Additional Install Features - Archive of obsolete content
« previous this section describes some more specifics of installers. installer file manipulation the previous section described a basic installer. you may wish to perform some more elaborate processing during the installation. for example, you may want to install a package only when certain conditions are met, such as having a particular library installed. in addition to the install object, a file object is also available during an installation script. it provides some functions which can be used to examine and modify files on disk. you can use these to move, copy or delete files before or after the files are installed. for example, you might want to make a backup of some files first. the following code will make a copy of the file "/bin/grep" and put it in the directory "/main".
Updating Commands - Archive of obsolete content
the command dispatcher handles that part. also, we could just call docommand without checking if the command was enabled or not, although we probably shouldn't do that. the code above is generic enough that it can be a function that takes a command as an argument and executes that command. this function could then be reused for all commands. in fact, this is common enough that mozilla includes a library which does just that. if you include the script 'chrome://global/content/globaloverlay.js' in a xul file, you can call the godocommand method which executes the command passed as the argument. the code for this function is only a few lines long so you could include it directly in your code if for some reason you didn't want to include the library. <script src="chrome://global/content/globaloverla...
Building XULRunner with Python - Archive of obsolete content
patches applied. microsoft c++ compiler is required and whilst the current free version is visual studio 8 express (msvc8) you will almost certainly want to use visual studio .net 2003 (msvc71) which is not longer officially available. the issue is that xulrunner must be built with the same version of c as python and with python 2.5 that is msvc71. both must use the same version of the c runtime library msvcrt?.dll or crashes will ensue. the alternative is to build python with msvc8 as well asmozilla, but that may be problematic. it might also be possible to use the open source mingw compiler with the correct msvc run time but that is apparently not recommended. apply any service packs and for msvc71 sp 1 is available. the matching platform sdk is also needed and for msvc71 that is .net framewor...
XULRunner FAQ - Archive of obsolete content
y than generic full-featured runtimes. if i use xulrunner do i have to write my application in xul? no! you can write your application in any language supported by the mozilla web platform, including html, xhtml, svg, or xul. so why is it called xulrunner, instead of htmlrunner or something? xul was always the original language of choice for ui in mozilla applications and the main library is called libxul, mostly the name is a hangover from that that has now stuck. when will firefox be based on xulrunner? there is no intention to do this for official release versions of firefox. it is already possible to run firefox on xulrunner now though and certain linux distributions already do this. why is installing xulrunner so painful? why isn't there a nice installer? beca...
XULRunner Hall of Fame - Archive of obsolete content
th i18n support. mathml support is significant. includes smil audio overlays and idpf fixed layout. celtx all-in-one media pre-production software. source chatzilla a standalone version of the chatzilla irc client. conkeror a highly programmable web browser with a leopard-oriented design inspired by emacs. source evergreen - staff client evergreen is an open source library system. source ieditweb a client/server based content manager and internet application suite. ieditweb users can add pages, images, forms, ecommerce many special effects and much more using the xulrunner based client. it will comunicate dyamically with the ieditweb server to maintain a fully configured web site with embedded web applications. it also contains a built in email marketing sy...
MacFAQ - Archive of obsolete content
(note this document has not been reviewed for accuracy or completeness.) special build notes enable libxul. in your .mozconfig for custom builds of xulrunner, add --enable-libxul. if you've completed a xulrunner build, you should copy or symlink the dist/xul.framework directory to /library/frameworks. note that in order to copy the framework while keeping the relative soft-links in the framework, do something like: % ( cd dist ; gnutar cf - xul.framework | ( cd /library/frameworks ; gnutar xf - )) installing your application your application must be installed as a xulrunner app before you can open it. to do this, type: xulrunner-bin --install-app /path/to/appdir note the path to your application must end with the directory containing application.ini; you should not reference application.i...
Using SOAP in XULRunner 1.9 - Archive of obsolete content
since the native soap interface was removed from gecko 1.9, those stuck speaking to soap apis need a new place to turn. after some experimentation, the following seems to be the best way to speak soap in xulrunner. several alternatives were considered: soapclient 2.4 - this library contains a few javascript mistakes but nevertheless seems (fairly) widely used, mature and tested. it requires servers to support wsdl which took it out of the running. xulrunner 1.8.* - using an old xulrunner is certainly an option but brings up a host of speed, stability and memory issues. manual implementation - the author doesn't know enough about soap to implement a robust client in an afternoon. the best solution proved to be jqsoapclient. this library doesn't require a wsdl. though jquery is listed as ...
nsIContentPolicy - Archive of obsolete content
esource. arequestorigin optional. the location of the resource that initiated this load request; can be null if inapplicable. acontext optional. the nsidomnode or nsidomwindow that initiated the request, or something that can query interface to one of those; can be null if inapplicable. amimetype the mime type of the requested resource (for example, image/png), as reported by the networking library, if available (may be empty if inappropriate for the type, e.g., type_refresh). aextra an optional argument, pass-through for non-gecko callers to pass extra data to callees. arequestprincipal optional. the requesting principal. return value accept or reject_* example you can implement this interface easily by including the nsicontentpolicy.h header file and implementing public nsicon...
Archived Mozilla and build documentation - Archive of obsolete content
operating system and platform transparent interface to mozilla platforms of interest. mozprocess aims to provide the ability to robustly terminate a process (by timeout or otherwise), along with any child processes, on windows, os x, and linux. mozprocess utilizes and extends subprocess.popen to these ends. nanojit nanojit is a small, cross-platform c++ library that emits machine code. both the tamarin jit and the spidermonkey jit (a.k.a. tracemonkey) use nanojit as their back end. new skin notes devmo has a new skin that is ready for testing. if you go to your user preferences, you can change the skin to "devmo". this is currently just a preview, but we would appreciate help with testing. plug-n-hack plug-n-hack (pnh) is...
Mozilla release FAQ - Archive of obsolete content
he tree has changed enough that we'll probably need new times for all the builds. please send stats to me in the following format: cpu/mhz, architecture, ram, disk type, os version, compiler version, build type, tree date -- build time example: 21164/533, alpha, 512m edo, ultra2 scsi, linux kernel 2.2.11, gcc 2.95, non-debug, 19 august 1999 cvs -- 25 minutes how do i run the binary on unix? i get library errors in dist/bin there's a script called mozilla. use that to launch mozilla for you -- it sets ld_library_path automatically. to launch other binaries from dist/bin with the correct environment, use run-mozilla.sh ./your_binary features, patches what platforms is mozilla available for? mozilla is currently targeted for win32, macos, and unix/x systems. mozilla also runs on mac os x, os/2, and ...
2006-11-03 - Archive of obsolete content
g easily available for download. suggestion: a built-in firefox feature a user suggests a feature to compare different versions of a webpage to see what has changed. xml in firefox is a major problem a user draws attention to what they think is a bug, but the developers say it's proper browser behaviour. what gui lib was used for developing firefox 2.0 ? a user inquires about what gui library is used for developing firefox 2.0. event in firefox similar to ondownloadcomplete event in ie a user asks what even can be used that is similar to the ondownloadcomplete even in ie. meetings none this week. authors sara minchella (sara) dave manley (senemanley) back to summary list ...
2006-11-04 - Archive of obsolete content
now being easily available for download. suggestion: a built-in firefox feature a user suggests a feature to compare different versions of a webpage to see what has changed. in firefox is a major problem a user draws attention to what they think is a bug, but the developers say it's propwer browser behaviour. gui lib was used for developing firefox 2.0 ? a user inquires about what gui library is used for developing firefox 2.0. in firefox similar to ondownloadcomplete event in ie a user asks what even can be used that is similar to the ondownloadcomplete even in ie. meetings none this week. authors sara minchella (sara) dave manley (senemanley) back to summary list ...
JS-Engine FAQ - Archive of obsolete content
domparser is not part of js but part of mozilla browser which makes it available to script in the browser using xpconnect. an alternative would be to use built-in e4x. newly created threads in js from mozilla_1_8_branch causes to hang in windows patch from bug 351602 should fix the problem. after applying that patch, recompile js and define js_use_only_nspr_locks in the build. spidermonkey library loading mechanism? to write wrappers in pure javascript to interface with any c library on the system there are mechanisms such as xpcshell, wxjs, jsdb, jsni coding spidermonkey in c check out this tutorial how to compile tamarin on linux/x86 there is a patch that allows you to compile it. rhino what is the performance between rhino js and native java rhino js is significantly slower in r...
2006-09-06 - Archive of obsolete content
dk and g++ components discussion on the problems and possible solutions running cygwin/g++ compiled xpcom components with windows-based gecko-sdk/xulrunner dll/exes. threading in xpcom rules on threading in xpcom or to firefox extensions. how to build xpcom component on mac os x a tutorial on how to build xpcom component on mac os x firefox crashes when calling a function provided by a .so library a solution to the problem loading a shared library when using xpcom firefoxes crashes while getting url in xpcom solutions to resolve the problem of the firefox crash when trying to get the path and the prepath of the url of the current page in xpcom meetings none during this week. ...
2006-11-3 - Archive of obsolete content
meetings none during this week. ...
External resources for plugin creation - Archive of obsolete content
ins (plugins for browsers such as google chrome or firefox), letting you easily expose c++ classes to javascript from a simple idl representation. nixysa was originally conceived for the needs of o3d, but is flexible enough to support a wide range of use cases. project: juce project home page description (from the home page): juce (jules' utility class extensions) is an all-encompassing c++ class library for developing cross-platform applications. it contains pretty much everything you're likely to need to create most applications, and is particularly good for creating highly-specialised uis and for handling graphics and sound. supported development environments are xcode, visual studio, gcc (and probably any other modern c++ compiler) browser plugins can be built as npapi (mac/windows), or act...
Shipping a plugin as a Toolkit bundle - Archive of obsolete content
or in a bundle as described here. bundle structure toolkit bundles can be used for all add-ons including extensions, themes and plugins. plugin packages should only need to package a small set of files in the following structure in the xpi file: install.rdf plugins/ pluginlib.dll plugintypes.xpt the install.rdf file contains an install manifest that describes the plugin to the user. the library and scripting interfaces are held in the plugins directory. platform-specific files gecko 1.9.2 (firefox 3.6) and earlier prior to gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), it was possible to package multiple plugin libraries for different operating systems into a single xpi bundle. in the xpi you can use the following structure: platform/ linux_x86-gcc3/ plugins/ ...
Writing a plugin for Mac OS X - Archive of obsolete content
started if you check out the mozilla source code in mac os x, you can simply open basicplugin.xcodeproj in xcode, click build, and you're done. xcode will create a "build" directory next to the project file, and if you built it in release mode, that folder in turn contains a "release" directory with the plugin inside it. to install the plugin, just copy it into one of these two locations: /library/internet plugins/ ~/library/internet plugins/ from this point, you can simply modify the sample plugin to do whatever you want. notes and tips this section provides some additional information that may be helpful if you're trying to get a plugin building on your own. info.plist the plugin communicates its mime and filename extension information using the info.plist file, which is packaged ...
Introduction to Public-Key Cryptography - Archive of obsolete content
ion. to get a driver's license, you typically apply to a government agency, such as the department of motor vehicles, which verifies your identity, your ability to drive, your address, and other information before issuing the license. to get a student id, you apply to a school or college, which performs different checks (such as whether you have paid your tuition) before issuing the id. to get a library card, you may need to provide only your name and a utility bill with your address on it. certificates work much the same way as any of these familiar forms of identification. certificate authorities (cas) are entities that validate identities and issue certificates. they can be either independent third parties or organizations running their own certificate-issuing server software (such as red ha...
Building a Theme - Archive of obsolete content
can change from platform to platform and system to system), mozilla developers came up with a solution for creating uris to content that the installed add-on knows about. the browser window is: chrome://browser/content/browser.xul. try typing this url into the location bar in firefox! chrome uris consist of several components: firstly, the uri scheme (chrome) which tells firefox's networking library that this is a chrome uri. it indicates that the content of the uri should be handled as a (chrome). compare (chrome) to (http) which tells firefox to treat the uri as a web page. secondly, a package name (in the example above, browser) which identifies the bundle of user interface components. thirdly, the type of data being requested. there are three types: content (xul, javascript, xbl bindin...
Date.prototype.toLocaleFormat() - Archive of obsolete content
he date object instead of using this method. examples using tolocaleformat() var today = new date(); var date = today.tolocaleformat('%a, %b %e, %y'); in this example, tolocaleformat() returns a string such as "wednesday, october 3, 2007". note that the format string in this example is not properly localized, which will result in the problems described above. polyfill when using the datejs library you can polyfill date.prototype.tolocaledatestring() like this: if (!date.prototype.tolocaleformat) { (function() { date.prototype.tolocaleformat = function(formatstring) { return this.format(formatstring); }; }()); } specifications not part of any standard. ...
ScriptEngineBuildVersion - Archive of obsolete content
non-standard. do not use! this object is a microsoft extension and is only supported in internet explorer. the scriptenginebuildversion function bets the build version number of the scripting engine in use. syntax scriptenginebuildversion() remarks the return value corresponds directly to the version information contained in the dynamic-link library (dll) for the scripting language in use. example the following example illustrates the use of the scriptenginebuildversion function: if(window.scriptenginebuildversion) { console.log(window.scriptenginebuildversion()); } // output: <current build version> requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 stand...
ScriptEngineMajorVersion - Archive of obsolete content
non-standard. do not use! this object is a microsoft extension and is only supported in internet explorer. the scriptenginemajorversion function gets the major version number of the scripting engine in use. syntax scriptenginemajorversion() remarks the return value corresponds directly to the version information contained in the dynamic-link library (dll) for the scripting language in use. example the following example illustrates the use of the scriptenginemajorversion function: if (window.scriptenginemajorversion) { console.log(window.scriptengine()); } output: <current major version> requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, internet...
ScriptEngineMinorVersion - Archive of obsolete content
non-standard. do not use! this object is a microsoft extension and is only supported in internet explorer. the scriptengineminorversion function gets the minor version number of the scripting engine in use. syntax scriptengineminorversion() remarks the return value corresponds directly to the version information contained in the dynamic-link library (dll) for the scripting language in use. example the following example illustrates the use of the scriptengineminorversion function. if (window.scriptengineminorversion) { console.log(window.scriptengineminorversion()); } //output: <current minor version> requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 stan...
ECMAScript 2015 support in Mozilla - Archive of obsolete content
ation and bug fixing period. finally, ecma-262 edition 6 got officially approved and published as a standard on june 17, 2015 by the ecma general assembly. it will also appear as the international industry standard iso/iec 16262:2016. a pdf and html version of the standard can be freely downloaded on ecma-international.org. a channel for feedback on ecmascript standards is es-discuss. ...
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
next a script named validatecomments.js is hooked in with the runat attribute set to both. the function defined within this file checks the form to make sure it is complete, returning a boolean. the both context it operates within is a very powerful concept as we are able to use this code to check values entered in the form on both the client ...
Implementation Status - Archive of obsolete content
l scenarios exist where controls contained inside other controls inside a repeat won't be bound correctly 333638; 7.4.5 ui binding in other xml vocabularies unsupported not a compliance requirement for an xforms processor 7.4.6 binding examples supported 7.5 xforms core function library supported 7.6.1 boolean-from-string() supported 7.6.2 is-card-number() unsupported 7.7.1 avg() supported 7.7.2 min() supported 7.7.3 max() supported ...
Archive of obsolete content
tension much easier to localize into various languages without having to edit the xul or javascript files themselves. makefile - .mk files misc top level these pages were moved from the top level of mdn in a spate of furious reorganization. mmgc mmgc is the tamarin (née macromedia) garbage collector, a memory management library that has been built as part of the avm2/tamarin effort. it is a static library that is linked into the flash player but kept separate, and can be incorporated into other programs. mozilla release faq this document may be distributed and modified freely. no guarantee of factuality in this faq is made, and it is maintained by pat gunn, who is not affiliat...
Bounding volume collision detection with THREE.js - Game development
it is assumed that before reading this you have read our 3d collision detection introductory article first, and have basic knowledge about three.js. using box3 and sphere three.js has objects that represent mathematical volumes and shapes — for 3d aabb and bounding spheres we can use the box3 and sphere objects. once instantiated, they have methods available to do intersection tests against other volumes. instantiating boxes to create a box3 instance, we need to provide the lower and upper boundaries of the box. ...
Building up a basic demo with A-Frame - Game development
off by: making sure you are using a modern browser with good webgl support (and webxr support if you have available vr or ar hardware) such as the latest firefox or chrome — download firefox nightly or chrome (v54 or higher). (optional) set up a vr device such as oculus rift or google cardboard. create a new directory to store your project in. save a copy of the latest a-frame javascript library file inside your directory (check the github repository for latest stable a dev builds). open the a-frame documentation in a separate tab — it is useful to refer to. html structure the first step is to create an html document — inside your project directory, create a new index.html file, and save the follow html inside it: <!doctype html> <html> <head> <meta charset="utf-8"> <title>m...
Building up a basic demo with the PlayCanvas engine - Game development
ar canvas = document.getelementbyid("application-canvas"); /* all our javascript code goes here */ </script> </body> </html> it contains some basic information like the document <title>, and some css to set the width and height of the <canvas> element that playcanvas will use to 100% so that it will fill the entire available viewport space. the first <script> element includes the playcanvas library in the page; we will write our example code in the second one. there is one helper variable already included, which will store a reference to the <canvas> element. before reading on, copy this code to a new text file and save it in your working directory as index.html. playcanvas application to begin developing our game we have to create the playcanvas application first (using the given <canva...
Building up a basic demo with PlayCanvas - Game development
d, shooting at other players as you go. swooop is a flying game where you pilot your plane around a magical island, collecting jewels and fuel as you go. visualizations like the star lord and bmw i8 also take advantage of the engine and showcase what's possible. note: check out the list of featured demos to find more examples. engine vs editor the engine itself can be used as a standard library by including its javascript file directly in your html, so you can start coding right away; in addition the playcanvas toolset comes with an online editor that you can use to drag and drop components onto the scene — a great way to create games and other apps requiring scenes if you're more of a designer than a coder. those approaches are different but work equally well regarding achieving end ...
Desktop gamepad controls - Game development
r('dpad-right'). you can see a live demo in action — try connecting your gamepad and pressing the buttons. phaser approach let's move on to the final gamepad api implementation in the captain rogers: battle at andromeda game we created with phaser. this is pure javascript code however too, so can be used in any other project no matter what framework was used. first off, we'll create a small library that will take care of handling the input for us. here's the gamepadapi object, which contains useful variables and functions: var gamepadapi = { active: false, controller: {}, connect: function(event) {}, disconnect: function(event) {}, update: function() {}, buttons: { layout: [], cache: [], status: [], pressed: function(button, state) {}...
Unconventional controls - Game development
ogether waving your hand and using the microphone. this time it's about detecting sound waves bouncing off objects and returning to the microphone. if the frequency of the bounced sound is shifted from the original one, then we can detect that the movement of that object occured. that way we can detect a hand movement by using only a built-in microphone! this can be accomplished using a small library created by daniel rapp — it can be as simple as calculating the difference between two frequencies: doppler.init(function(bandwidth) { var diff = bandwidth.left - bandwidth.right; }); the diff would be the difference between the initial position of the hand and the final one. this approach won't give us the full flexibility of using a gamepad, or even leap motion, but it's definitely an ...
Efficient animation for web games - Game development
where redraws were happening several times per frame, and some of the animations caused firefox to need to redraw everything (they were fine in other browsers, as it happens — that particular issue is now fixed). some of the third party code we were using was poorly optimised. a take-away to help combat poor animation performance, chris lord wrote animator.js, a simple, easy-to-use animation library, heavily influenced by various parts of clutter, but with a focus on avoiding scope-creep. it does one thing, and it does it well. animator.js is a fire-and-forget style animation library, designed to be used with games, or other situations where you need many, synchronised, custom animations. it includes a handful of built-in tweening functions, the facility to add your own, and helper functions...
WebRTC data channels - Game development
n fact, aren't guaranteed to arrive at all. this is analogous to a udp socket. we have documentation for using webrtc. this article, however, will take advantage of some libraries that can help trivialize the work, and will demonstrate ways to use abstraction to work around implementation differences between browsers. hopefully, of course, those differences will fade away in time. using the p2p library one library you can use is the p2p library. this library provides a simple api for creating peer connections and setting up streams and data channels. there's also a broker server component and a hosted broker you can use instead of having to set one up for yourself. note: we will continue to add content here soon; there are some organizational issues to sort out. original document informat...
2D breakout game using pure JavaScript - Game development
t's good to learn about the language itself first to know what exactly is going on under the hood. frameworks speed up development time and help take care of boring parts of the game, but if something is not working as expected, you can always try to debug that or just write your own solutions in pure javascript. note: if you are interested in learning about 2d web game development using a game library, consult this series' counterpart, 2d breakout game using phaser. note: this series of articles can be used as material for hands-on game development workshops. you can also make use of the gamedev canvas content kit based on this tutorial if you want to give a talk about game development in general. next steps ok, let's get started! head to the first chapter— create the canvas and draw o...
Initialize the framework - Game development
reload: preload, create: create, update: update }); function preload() {} function create() {} function update() {} </script> </body> </html> downloading the phaser code next, we need to go through the process of downloading the phaser source code and applying it to our html document. this tutorial uses phaser v2 — it won't work with the current version on phaser (v3). the v2 library is still available on the phaser download page, below the links for the v3 download. go to the phaser download page. choose an option that suits you best — i would recommend the min.js option as it keeps the source code smaller, and you are unlikely need to go through the source code anyway. save the phaser code inside a /js directory in the same location as your index.html file. update t...
Visual-js game engine - Game development
t based game engine (client part ts). with strong connection with webpack physics done with (matter.js) matter ts this part is removed from this project. new link is : https://github.com/zlatnaspirala/visual-ts-game-engine basic licence rules : 1) each file in this project has its own license , be careful , do not violate the basic rules. 2) you are free to use any version of visual js library in any other project (even commercial projects) as long as the copyright header is left intact except for plugins on sale and graphics that come with them (they have special commercial licence). 3) please read the following terms and conditions before using this application: disclaimer of warranty 'visual js' is provided "as-is" and without warranty of any kind, express, impl...
Blink - MDN Web Docs Glossary: Definitions of Web-related terms
blink is an open-source browser layout engine developed by google as part of chromium (and therefore part of chrome as well). specifically, blink began as a fork of the webcore library in webkit, which handles layout, rendering, and dom, but now stands on its own as a separate rendering engine. ...
CDN - MDN Web Docs Glossary: Definitions of Web-related terms
of servers spread out over many locations. these servers store duplicate copies of data so that servers can fulfill data requests based on which servers are closest to the respective end-users. cdns make for fast service less affected by high traffic. cdns are used widely for delivering stylesheets and javascript files (static assets) of libraries like bootstrap, jquery etc. using cdn for those library files is preferable for a number of reasons: serving libraries' static assets over cdn lowers the request burden on an organization's own servers. most cdns have servers all over the globe, so cdn servers may be geographically nearer to your users than your own servers. geographical distance affects latency proportionally. cdns are already configured with proper cache settings. using a cdn s...
Java - MDN Web Docs Glossary: Definitions of Web-related terms
programs are compiled only once ahead of time into a proprietary byte code and package format that runs inside the java virtual machine (jvm). the jvm is available across many platforms, which allows java programs to run almost everywhere without the need to be compiled or packaged again. ...
OpenGL - MDN Web Docs Glossary: Definitions of Web-related terms
the api is typically used to interact with a graphics processing unit (gpu), to achieve hardware-accelerated rendering. ...
Three js - MDN Web Docs Glossary: Definitions of Web-related terms
three.js is a javascript-based webgl engine that can run gpu-powered games and other graphics-powered apps straight from the browser. the three.js library provides many features and apis for drawing 3d scenes in your browser. learn more general knowledge three.js on wikipedia three.js official website ...
WebGL - MDN Web Docs Glossary: Definitions of Web-related terms
the khronos group maintains webgl, which is based on opengl es 2.0. you can invoke webgl within the html <canvas> element, which provides a rendering surface. all major browsers now support webgl, but its availability depends also on external factors (e.g. gpu support). ...
WebKit - MDN Web Docs Glossary: Definitions of Web-related terms
mobile browsers (since webkit is highly portable and customizable). webkit began life as a fork of kde's khtml and kjs libraries, but many individuals and companies have since contributed (including kde, apple, google, and nokia). webkit is an apple trademark, and the framework is distributed under a bsd-form license. however, two important components fall under the lgpl: the webcore rendering library and the javascriptcore engine. learn more general knowledge webkit on wikipedia technical reference webkit css extensions ...
jQuery - MDN Web Docs Glossary: Definitions of Web-related terms
jquery uses a format, $(selector).action() to assign an element(s) to an event. to explain it in detail, $(selector) will call jquery to select selector element(s), and assign it to an event api called .action(). ...
MDN Web Docs Glossary: Definitions of Web-related terms
xinclude xlink xml xpath xquery xslt other 404 502 alpn at-rule attack byte-order mark character set client cryptosystem debug digital signature execution flex-direction glsl interface library memory management routers self-executing anonymous function stylesheet vector image ...
Accessible multimedia - Learn web development
s recorded in), you need to include text tracks along with your video content. note: text tracks are also useful for potentially any user, not just those with disabilities. for example, some users may not be able to hear the audio because they are in noisy environments (like a crowded bar when a sports game is being shown) or might not want to disturb others if they are in a quiet place (like a library.) this is not a new concept — television services have had closed captioning available for quite a long time: whereas many countries offer english films with subtitles written in their own native languages, and different language subtitles are often available on dvds, for example there are different types of text track with different purposes. the main ones you'll come across are: ca...
WAI-ARIA basics - Learn web development
create a button, and can use a <button> element, you should use a <button> element! guiding users through complex widgets there are a whole host of other roles that can identify non-semantic element structures as common ui features that go beyond what's available in standard html, for example combobox, slider, tabpanel, tree. you can see a number of useful examples in the deque university code library, to give you an idea of how such controls can be made accessible. let's go through an example of our own. we'll return to our simple absolutely-positioned tabbed interface (see hiding things in our css and javascript accessibility article), which you can find at tabbed info box example (see source code). this example as-is works fine in terms of keyboard accessibility — you can happily tab be...
Legacy layout methods - Learn web development
its head: <link href="normalize.css" rel="stylesheet"> <link href="skeleton.css" rel="stylesheet"> skeleton includes more than a grid system — it also contains css for typography and other page elements that you can use as a starting point. we’ll leave these at the defaults for now, however — it’s the grid we are really interested in here. note: normalize is a really useful little css library written by nicolas gallagher, which automatically does some useful basic layout fixes and makes default element styling more consistent across browsers. we will use similar html to our earlier example. add the following into your html body: <div class="container"> <div class="row"> <div class="col">1</div> <div class="col">2</div> <div class="col">3</div> <div class="col">4</...
Client-side form validation - Learn web development
orm validation features, which we've discussed in many places throughout this module. this validation generally doesn't require much javascript. built-in form validation has better performance than javascript, but it is not as customizable as javascript validation. javascript validation is coded using javascript. this validation is completely customizable, but you need to create it all (or use a library). using built-in form validation one of the most significant features of html5 form controls is the ability to validate most user data without relying on javascript. this is done by using validation attributes on form elements. we've seen many of these earlier in the course, but to recap: required: specifies whether a form field needs to be filled in before the form can be submitted. minle...
The HTML5 input types - Learn web development
n't have the best browser support. at the moment, chrome, edge, and opera support them well, but there is no support in internet explorer, safari has some mobile support (but no desktop support), and firefox supports time and date only. the reference pages linked to above provide suggestions on how to program fallbacks for non-supporting browsers; another option is to consider using a javascript library to provide a date picker. most modern frameworks have good components available to provide this functionality, and there are standalone libraries available too (see top date picker javascript plugins and libraries for some suggestions). color picker control colors are always a bit difficult to handle. there are many ways to express them: rgb values (decimal or hexadecimal), hsl values, keywords...
Video and audio content - Learn web development
certain times. for example: many people have auditory impairments (such as being hard of hearing or deaf) so can't hear the audio clearly if at all. others may not be able to hear the audio because they are in noisy environments (like a crowded bar when a sports game is being shown). similarly, in environments where having the audio playing would be a distraction or disruption (such as in a library or when a partner is trying to sleep), having captions can be very useful. people who don't speak the language of the video might want a text transcript or even translation to help them understand the media content. wouldn't it be nice to be able to provide these people with a transcript of the words being spoken in the audio/video? well, thanks to html video, you can. to do so we use the webv...
Index - Learn web development
o test and overcome them. 263 implementing feature detection article, beginner, css, codingscripting, javascript, learn, modernizr, testing, tools, cross browser, feature detection this article covered feature detection in a reasonable amount of detail, going through the main concepts and showing you how to both implement your own feature detection tests and use the modernizr library to implement tests more easily. 264 introduction to automated testing article, automation, beginner, codingscripting, learn, sauce labs, testing, tools, web stack, cross browser this was quite a ride, but i'm sure you can start to see the benefits of using automation tools to do some of the heavy lifting in terms of testing. 265 introduction to cross browser testin...
Making asynchronous programming easier with async and await - Learn web development
eeting().then(console.log); browser support one consideration when deciding whether to use async/await is support for older browsers. they are available in modern versions of most browsers, the same as promises; the main support problems come with internet explorer and opera mini. if you want to use async/await but are concerned about older browser support, you could consider using the babeljs library — this allows you to write your applications using the latest javascript and let babel figure out what changes if any are needed for your user’s browsers. on encountering a browser that does not support async/await, babel's polyfill can automatically provide fallbacks that work in older browsers. conclusion and there you have it — async/await provide a nice, simplified way to write async ...
Introducing asynchronous JavaScript - Learn web development
e strict order they are placed in the event queue. error handling is much better — all errors are handled by a single .catch() block at the end of the block, rather than being individually handled in each level of the "pyramid". promises avoid inversion of control, unlike old-style callbacks, which lose full control of how the function will be executed when passing a callback to a third-party library. the nature of asynchronous code let's explore an example that further illustrates the nature of async code, showing what can happen when we are not fully aware of code execution order and the problems of trying to treat asynchronous code like synchronous code. the following example is fairly similar to what we've seen before (see it live, and the source). one difference is that we've included...
Graceful asynchronous programming with Promises - Learn web development
o understand, but it is not really very async. the asynchronous nature is basically faked using settimeout(), although it does still show that promises are useful for creating a custom function with a sensible flow of operations, good error handling, etc. one example we'd like to invite you to study, which does show a useful async application of the promise() constructor, is jake archibald's idb library. this takes the indexeddb api, which is an old-style callback-based api for storing and retrieving data on the client-side, and allows you to use it with promises. in the code you'll see the same kind of techniques we discussed above being used there. the following block converts the basic request model used by many indexeddb methods to use promises (see this code, for example). conclusion prom...
Introduction to web APIs - Learn web development
h to your web page to speed up or enable writing common functionality. examples include jquery, mootools and react. javascript frameworks — the next step up from libraries, javascript frameworks (e.g. angular and ember) tend to be packages of html, css, javascript, and other technologies that you install and then use to write an entire web application from scratch. the key difference between a library and a framework is “inversion of control”. when calling a method from a library, the developer is in control. with a framework, the control is inverted: the framework calls the developer's code. what can apis do? there are a huge number of apis available in modern browsers that allow you to do a wide variety of things in your code. you can see this by taking a look at the mdn apis index pa...
Inheritance in JavaScript - Learn web development
e of the new ecmascript features that allow us to do inheritance more cleanly in javascript (see classes). we didn't cover those here, as they are not yet supported very widely across browsers. all the other code constructs we discussed in this set of articles are supported as far back as ie9 or earlier, and there are ways to achieve earlier support than that. a common way is to use a javascript library — most of the popular options have an easy set of functionality available for doing inheritance more easily and quickly. coffeescript for example provides class, extends, etc. a further exercise in our oop theory section, we also included a student class as a concept, which inherits all the features of person, and also has a different greeting() method from person that is much more informal t...
Object building practice - Learn web development
if a collision is detected, the code inside the inner if statement is run. in this case we only set the color property of both the circles to a new random color. we could have done something far more complex, like get the balls to bounce off each other realistically, but that would have been far more complex to implement. for such physics simulations, developers tend to use a games or physics library such as physicsjs, matter.js, phaser, etc. you also need to call this method in each frame of the animation. add the following below the balls[i].update(); line: balls[i].collisiondetect(); save and refresh the demo again, and you'll see your balls change color when they collide! note: if you have trouble getting this example to work, try comparing your javascript code against our f...
JavaScript performance - Learn web development
ependencies. often times third party scripts and apis are added, including a/b testing, tracking pixels, and features like maps and support features. all of this javascript must be downloaded. eventually. performance optimizatins should include: reducing the amount of javascript that is needed. some features requiring complex javascript can be done with a few lines of javascript. requiring a library for other features may improve developer experience, but is all that javascript required? is there a lighter weight or home spun solutions? some features may not be necessary, and though they may add some bling, is the cost of the feature in terms of performance worth it? remove unused code split the javascript into smaller files code-split javascript into critical and non-critical parts. mo...
Server-side web frameworks - Learn web development
many microsoft products it benefits from excellent tools (often free), an active developer community, and well-written documentation. asp.net is used by microsoft, xbox.com, stack overflow, and many others. mojolicious (perl) mojolicious is a next-generation web framework for the perl programming language. back in the early days of the web, many people learned perl because of a wonderful perl library called cgi. it was simple enough to get started without knowing much about the language and powerful enough to keep you going. mojolicious implements this idea using bleeding edge technologies. some of the features provided by mojolicious are: a real-time web framework, to easily grow single-file prototypes into well-structured mvc web applications. restful routes, plugins, commands, perl-is...
React resources - Learn web development
is called client-side routing. it's possible to create many unique routes for your application (such as /home, /dashboard, or login/). the react community has produced two major libraries for client-side routing: react router and reach router. react router is well-suited to applications with complex routing needs, and it meets some edge cases better than reach router. react router is a larger library, however. reach router is well-suited to simpler applications, and automatically manages focus as the user navigates from page to page. focus management is essential in client-side routing — without it, keyboard users can be trapped in focus limbo, and screen-reader users may have no idea that they have moved to a new page. because reach router is better for accessibility, it's a good place ...
Handling common accessibility problems - Learn web development
accessibility problems highlighted. tenon: another nice online tool that goes through the code at a provided url and returns results on accessibility errors including metrics, specific errors along with the wcag criteria they affect, and suggested fixes. it requires a free trial signup to view the results. tota11y: an accessibility tool from the khan academy that takes the form of a javascript library that you attach to your page to provide a number of accessibility tools. let's look at an example, using wave. go to the wave homepage. enter the url of our bad-semantics.html example into the text input at the top of the page (or the url of another webpage you'd like to analyze) and press analyse your webpage. check out the description of the accessibility problems on the results page (th...
Introduction to cross browser testing - Learn web development
idget, etc. there are multiple general strategies to cross browser development, for example: get all the functionality working as closely as possible in all target browsers. this may involve writing different code paths that reproduce functionality in different ways aimed at different browsers, or using a polyfill to mimic any missing support using javascript or other technologies, or using a library that allows you to write a single bit of code and then does different things in the background depending on what the browser supports. accept that some things aren't going to work the same on all browsers, and provide different (acceptable) solutions in browsers that don't support the full functionality. sometimes this is inevitable due to device constraints — a cinema widescreen isn't going t...
Introducing a complete toolchain - Learn web development
y once and should be reusable in many future projects. you will probably want to review this part of the toolchain semi-regularly and consider if there's any upgrades or changes you should introduce, but this shouldn't be required too often. your toolchain will depend on your own needs, but for this example of a (possible) complete toolchain, the tools that will be installed up front will be: library installation tools — for adding dependencies. code revision control. code tidying tools — for tidying javascript, css, and html. code linting tools — for linting our code. library installation tools we'll use npm to install our tools, which you first met in chapter 2. you should have node.js and npm installed already, but if not, refer back to that section. note: though it's not cle...
Client-side tooling overview - Learn web development
you are searching for a general code formatter. pay attention to the popularity, quality, and maintenance scores, and how recently the package was last updated. also click through to the tool pages to find out how many monthly downloads a package has, and whether it has good documentation that you can use to figure out whether it does what you need it to do. based on these criteria, the date-fns library looks like a good date formatting tool to use. you'll see this tool in action and learn more about package managers in general in chapter 3 of this module. if you are looking for a plugin to integrate tool functionality into your code editor, look at the code editor’s plugins/extensions page — see atom packages and vscode extensions, for example. have a look at the featured extensions on t...
Index
g the amo theme generator amo, add-ons, firefox, guide, tutorial, add-on the theme generator on addons.mozilla.org (amo) guides you through the process of creating a theme for firefox. once you have defined the colors and image for your theme, the generator will submit your new theme to amo. you may submit themes for publishing on amo or for self-distribution. 688 third party library usage add-ons, extensions, review policy to complete the review process at addons.mozilla.org (amo), reviewers must be able to verify the code in your extension. you may include third-party libraries in your extension. in that case, when you upload your extension to amo, you will need to provide links to the library source code. 689 updates firefox supports automat...
Testopia
as always please backup your installation before attempting to install or upgrade. testopia 2.3 this version supports bugzilla 3.4. the main new features are: support xml export and import of test plans and children support csv export of test cases and results. new reports: worst offender and case roll-up set priorities on indidual case-runs new clone options uses the latest extjs 3.0 library converts testopia into a true bugzilla extension numerous bug fixes integration points testopia integrates with bugzilla products, components, versions, and milestones to allow a single management interface for high level objects. testopia allows users to login to one tool and uses bugzilla group permissions to limit access to modifying test objects. testopia allows users to...
Command line options
he default location for your system (e.g., program files, applications, usr, lib) at vendorname/applicationname. applications may be uninstalled per usual methods for your system. "c:\program files\mozilla xulrunner\1.8.0.4\xulrunner\xulrunner.exe" --install-app "c:\users\billdo\desktop\myapplication.xpi" /opt/xulrunner/1.8.0.4/xulrunner/xulrunner --install-app ~/desktop/myapplication.xulapp /library/frameworks/xul.framework/xulrunner-bin --install-app ~/desktop/myapplication.xpi --register-global registers xulrunner on the system for all users. must be run as admin / root. --register-user registers xulrunner for a single user. --unregister-global unregisters xulrunner for all users. --unregister-user unregisters xulrunner for a single user. chrome -chrome chrome_url load the speci...
Debugging Frame Reflow
options --enable-debug in your .mozconfig file). create a text file (for instance reflow_rules.txt). enter this line in the text file * 1 this should look like: point the gecko_display_reflow_rules_file environment variable to the path of the reflow_rules.txt file. run the debug build, saving stdout to a file. on mac this is accomplished with: $ env dyld_library_path="`pwd`/obj-ff-dbg/dist/nightlydebug.app/contents/macos" \ ./obj-ff-dbg/dist/nightlydebug.app/contents/macos/firefox-bin > logfile.txt after loading your testcase, the log file will contain the promised information. log file analysis the log file for a simple table like <!doctype html public "-//w3c//dtd html 4.01 transitional//en"> <html> <head> <meta http-equiv="conten...
Debugging on Windows
oftpublicsymbols" appended to the cache directory configured in visual studio. downloading all symbols can take a long time; you can replace c:\windows\syswow64\ with the name of a single .dll to download symbols only for the specific libraries you are trying to debug. unfortunately, it's hard to know which symbols to download without having vs hang and seeing the "downloading symbols for <library>" status at the bottom left of the main window. problems post-mortem debugging on windows 7 sp1 x64? if you attempt to use ns_debugbreak etc to perform post-mortem debugging on a 64bit windows 7, but as soon as you try and continue debugging the program crashes with an access violation, you may be hitting a windows bug relating to avx support. for more details, including a work-around see this...
Makefiles - Best practices and suggestions
dependency builds - a second invocation of make within a sandbox should always be a nop. hardcoded values - avoid them like the plague. use variable assignments, autogen paths and dynamic file gathering. platform specific - avoid this logic whenever possible. code as little platform specific logic within a makefile as possible, a conditional and compiler flags at most should be needed. for ex use defines within sources to shift platform logic into your source code. ...
Eclipse CDT Manual Setup
main eclipse window and you should see the build console output flying by as eclipse processes it. it should take about 5-10 minutes for eclipse to finish processing the output. additional discovery for c++11 mode as of mozilla 25, mozilla is built in c++11 mode. when gcc is invoked in c++11 mode, it defines pre-processor symbols that enable conditional compilation of c++11 code in its standard library. to correctly parse this code, eclipse cdt needs to know about these symbols. unfortunately, the build option discovery process outlined above does not pick up this information, so cdt needs to be told separately about c++11 mode. to do this, go to "preferences -> c/c++ -> build -> settings -> [discovery] tab -> cdt gcc built-in compiler settings" and add the flag "-std=c++11" at the end of the f...
Obsolete Build Caveats and Tips
use it, you must use a previous version of it !), or 2005 professional from build_instructions those who need to work with the code for firefox 3/mozilla 1.9 and earlier can check out the latest source using cvs. in reality, you should probably not need to do this, since that code is very obsolete. this note below seems redundant as this is true by default https://msdn.microsoft.com/en-us/library/dh8che7s%28v=vs.110%29.aspx note: starting with gecko 7.0, you should no longer include "-zc:wchar_t-" in the command line when building on windows. if you're using visual studio, go to project properties > c/c++ > language > treat wchar_t as built-in type and set it to "yes". from source_code/mercurial mozilla-2.0 (firefox 4.0) code for the firefox 4.0 (gecko 2.0) release lives in relea...
Index
ozilla, protocols there is a lot of useful information about firefox hidden away behind the about: url protocol. the most useful is the url about:config, which displays preferences and settings that can be inspected and changed. 141 index firefox, index, mozilla found 168 pages: 142 linux compatibility matrix the following table lists the available library versions for the mozilla.org-distributed firefox builds dependencies, and/or to build firefox. 143 multiple firefox profiles beginner, firefox, guide, intro, profiles, qa a profile in firefox is the collection of settings, customizations, add-ons, and other personalizations that a user has made or installed into their copy of firefox. you can find details about profiles on mo...
Linux compatibility matrix
the following table lists the available library versions for the mozilla.org-distributed firefox builds dependencies, and/or to build firefox. distribution kernel glibc glib gtk+2 gtk+3 pixman stdc++ gcc clang python3 released eol fedora 16 3.1 2.14 2.30 2.24 3.2 0.22 4.6 4.6 2.9 n/a nov 2011 feb 2013 fedora 17 3.3 2.15 2.32 2.24 3.4 0.24 4.7 4.7 3.0 n/a may 2012 jul 2013 fedora 18 3.6 2.16 2.34 2.24 3.6 0.26 4.7 4.7 3.1 n/a jan 2013 jan 2014 fedora 19 3.9 2.17 2.36 2.24 3.8 0.30 4.8.1 4.8 3.3 n/a jul 2013 jan 2015 fedora 20 3.11 2.18 2.38 2.24 3.10...
Multiple Firefox profiles
by the full path to the profile folder you wish to launch into. this will launch firefox immediately. otherwise, enter a space character followed by --profilemanager. this will present the profile manager window in which you can make your selection. hit return. here is a complete example terminal command from steps 2-3: /applications/firefox.app/contents/macos/firefox -profile /users/suzie/library/application\ support/firefox/profiles/r99d1z7c.default if the profile manager window does not open, firefox may have been running in the background, even though it was not visible. close all instances of firefox, or restart the computer, and then try again. if you want to do this frequently and more easily, you may wish to create an automator application, as explained in this tutorial. cre...
Firefox
are listed for the user to choose a destination to visit or a site to manage in some way. one example is the new tab page, which includes a "top sites" section showing sites you visit that firefox thinks you're likely to want to visit again, as well as potentially some sites that have been pinned to always appear in that space. linux compatibility matrixthe following table lists the available library versions for the mozilla.org-distributed firefox builds dependencies, and/or to build firefox.multiple firefox profilesa profile in firefox is the collection of settings, customizations, add-ons, and other personalizations that a user has made or installed into their copy of firefox. you can find details about profiles on mozilla's end-user support site.performance best practices for firefox fron...
JNI.jsm
all of the js-ctypes required for writing jni code. to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/jni.jsm"); this module was available in firefox since version 17. if you would like to support versions before that, you can copy and paste the contents of the jsm file int jni stands for java native interface; this library allows calling java code running in java virtual machines (jvms), etc. the most common use for this module is in add-ons and other works on firefox for android (fennec). with this module, all of the android sdk functions that firefox has permissions for are at your fingertips. a note about firefox for android, this jsm file is already globally imported and is available from the privileged window...
JavaScript OS.Constants
the current profile. homedir the path to the user's home directory. winappdatadir the path to the user's roaming application data directory. winlocalappdatadir the path to the user's local application data directory. winstartmenuprogsdir the path to the programs subdirectory in the user's start menu. macuserlibdir the path to the user's library directory. maclocalapplicationsdir the path to the local applications directory. os.constants.libc constants for interacting with libc. useful mostly for using js-ctypes to interact with the following platforms: macos x; android; linux; other variants of unix. os.constants.libc is available on all platforms, although some constants are not defined everywhere. before us...
Index
encodings for localization files internationalization, localization when creating a localization for mozilla products, it’s important to be aware of the encoding of the files that you generate. 5 index localization found 42 pages: 6 l10n checks internationalization, localization, localization:tools, tools l10n checks is a python script and library similar to compare-locales. it allows mozilla localizers to easily check their work. 7 l10n testing with xcode firefox for ios, localization once you have your l10n testing environment set up in xcode, testing your firefox on ios localization is a breeze. 8 localization and plurals internationalization, localization you're likely here because you're local...
L10n Checks
it allows mozilla localizers to easily check their work. installation (releases) l10n checks needs to be installed. to do that, you must have python 2.5, 2.6, or 2.7 installed on your machine. once python is installed, the easiest way to install l10n checks (on mac or linux) is to just run: $ sudo easy_install -u l10n-checks or, if you're on windows: $ easy_install -u l10n-checks installation (development versions) l10n checks needs to be installed, and it requires that you have python and mercurial installed on your machine. ...
Localization formats
tly (i.e. accidentally removes some html like </h1>, that localizer can break everything.) very hard to update automatically, if not impossible. can be hard to tell what has changed .lang files historically, mozilla has used a gettext-like file to present content for localization. .lang files provide some features that differentiate it from gettext: .lang is not dependent on php/.po library, so if our webdev team sets up a site without gettext support, we still have .lang. (it should be noted that this is near impossibility since most sites will be set up with gettext support.) .lang files can be easily edited in a text editor with this setup, a localizer is given a "[something].lang" file containing all the strings needing localization. that file will have the following structur...
Fonts for Mozilla's MathML engine
-on. note that using the add-on is not optimal since it forces your gecko browser to load a css stylesheet on each page you visit as well as web math fonts on all pages with mathml content. a better alternative on unix systems is to install the otf files for latin modern math and stix into some local font folder and (if necessary) to run fc-cache on it. on os x and linux, the standard paths are ~/library/fonts/ and ~/.fonts. fonts with a math table you can actually render mathml using any font with a math table and related open font format features. a list of such math fonts is provided below. you can use the advanced font preference menu to configure the default font for mathematics. alternatively, you can try the mathml-fontsettings add-on. asana math cambria math dejavu math tex gyre g...
Fonts for Mozilla 2.0's MathML engine
or fraktur text). all the fonts mentioned above may already be installed by default on your system or can easily be installed via your software manager. for convenience we provide a zip archive of mathml fonts. the fonts may be installed by extracting the font files (which have the .otf extension) from the zip archive, then following instructions for microsoft windows, or copying the files to a ~/library/fonts folder on mac os x, or to a ~/.fonts/ directory (which may need to be created) on unix/linux systems. alternatively, follow dafont's "how to install a font". these fonts are opentype postscript fonts, which are supported by most modern operating systems. however some operating systems may not support these fonts. on such systems, it will be necessary to convert the fonts to a supported form...
DMD
ns for linux. fennec in order to use dmd on fennec you will need root access on the android device. instructions on how to root your device is outside the scope of this document. build build with these options: ac_add_options --enable-dmd prep in order to prepare your device for running fennec with dmd enabled, you will need to do a few things. first, you will need to push the libdmd.so library to the device so that it can by dynamically loaded by fennec. you can do this by running: adb push $objdir/dist/bin/libdmd.so /sdcard/ second, you will need to make an executable wrapper for fennec which sets an environment variable before launching it. (if you are familiar with the recommended "--es env0" method for setting environment variables when launching fennec, note that you cannot use ...
Leak-hunting strategies and tips
srv*symsrv.dll*f:\localsymbols*http://msdl.microsoft.com/download/symbols as described in microsoft's article. this needs to be done when running, since we do the address to symbol mapping at runtime. linux many linux distros provide packages containing external debugging symbols for system libraries. fix_stacks.py uses this debugging information (although it does not verify that they match the library versions on the system). for example, on fedora, these are in *-debuginfo rpms (which are available in yum repositories that are disabled by default, but easily enabled by editing the system configuration). tips disabling arena allocation with many lower-level leak tools (particularly trace-malloc based ones, like leaksoup) it can be helpful to disable arena allocation of objects that you're ...
TimerFirings logging
heir creation site annotated. for unannotated function timers, there are three possible behaviours. first, on mac the code uses dladdr to get the name immediately, and the output will look like the following. 2082435840[100445640]: [81190] fn timer (one_shot 8000 ms): [from dladdr] gfxfontinfoloader::delayedstartcallback(nsitimer*, void*) second, on linux the code uses dladdr to get the symbol library and address, which can be post-processed by tools/rb/fix_stacks.py. the following two lines show the output before and after being post-processed by that script. 2088737280[7f606bf68140]: [30710] fn timer (one_shot 16 ms): [from dladdr] #0: ???[/home/njn/moz/mi1/o64/dist/bin/libxul.so +0x2144f94] 2088737280[7f606bf68140]: [30710] fn timer (one_shot 16 ms): [from dladdr] #0: mozilla::...
Performance
not (see bug 390944). leak gauge leak gauge is a tool that can be used to detect certain kinds of leaks in gecko, including those involving documents, window objects, and docshells. logalloc logalloc is a tool that dumps a log of memory allocations in gecko. that log can then be replayed against firefox's default memory allocator independently or through another replace-malloc library, allowing the testing of other allocators under the exact same workload. memory profiler the memory profiler samples allocation events and provides different views to analyze the allocation characteristic. see also the documentation on leak-hunting strategies and tips. profiling and performance tools profiling with the developer tools profiler the p...
McCoy
es. the cryptographic keys and other mccoy data are kept in a profile folder separate from the application so you can uninstall and reinstall without losing your precious keys. backing up data if you need to backup your data or move it from one machine to another you need to take a copy of the profile folder. this is located in: %appdata%\mozilla\mccoy (windows) ~/.mozilla/mccoy (linux) ~/library/application support/mccoy (mac os x) it is highly recommended that you back up your profile folder and store it in a safe location whenever you create a new key; without a backup, there is no way to recover your private keys if they are lost! running mccoy to run mccoy simply run the mccoy executable (or the mccoy application on os x). the first time it runs it will ask you to create a master...
NSPR Poll Method
pr file descriptors. pr_poll uses the poll method behind the scene, but it is also possible to use the poll method directly. we consider a stack of nspr i/o layers on top of the network transport. each i/o layer is represented by a prfiledesc structure and the protocol of that layer is implemented by a priomethods table. the bottom layer is a wrapper for the underlying network transport. the nspr library provides a reference implementation of the bottom layer using the sockets api, but you can provide your own implementation of the bottom layer using another network transport api. the poll method is one of the functions in the priomethods table. the prototype of the poll method is print16 poll_method(prfiledesc *fd, print16 in_flags, print16 *out_flags); the purpose of the poll method is to all...
Nonblocking IO In NSPR
d in a <tt>pr_transmitfile()</tt> call. since <tt>pr_transmitfile()</tt> only operates in blocking mode, this recycled socket can only be reused in blocking mode, hence the above constraint. because these constraints only apply to nt, it is advised that you test your cross-platform code that uses nonblocking io on nt early in the development cycle. these constraints are enforced in the debug nspr library by assertions. differences from blocking io in nonblocking mode, the timeout argument for the io functions is ignored. <tt>pr_acceptread()</tt> and <tt>pr_transmitfile()</tt> only work on blocking sockets. they do not make sense in nonblocking mode. <tt>pr_write()</tt>, <tt>pr_send()</tt>, <tt>pr_writev()</tt> in blocking mode block until the entire buffer is sent. in nonblocking mode, they...
Introduction to NSPR
ty. some operating systems cannot be made preemptable (for example, mac os and win 16). this puts them at some risk in supporting arbitrary code, even if the code is interpreted (java). other systems are not thread-aware, and their runtime libraries not thread-safe (most versions of unix). these systems can support local level thread abstractions that can be made preemptable, but run the risk of library corruption (libc). still other operating systems have a native notion of threads, and their libraries are thread-aware and support locking. however, if local threads are also present, and they are preemptable, they are subject to deadlock. at this time, the only safe solutions are to turn off preemption (a runtime decision) or to preempt global threads only. interrupting threads nspr threads ar...
NSPR Error Handling
d to allow the connection to be established. pr_network_unreachable_error the network address specifies a host that is unreachable (perhaps temporary). pr_connect_timeout_error the connection attempt did not complete in a reasonable period of time. pr_not_connected_error the preceding function attempted to use connected semantics on a network file descriptor that was not connected. pr_load_library_error failure to load a dynamic library. pr_unload_library_error failure to unload a dynamic library. pr_find_symbol_error symbol could not be found in the specified library. pr_insufficient_resources_error there are insufficient system resources to process the request. pr_directory_lookup_error a directory lookup on a network address has failed. pr_tpd_range_error attempt to access a ...
NSPR Types
s-platform declarations of prototypes and implementations: pr_extern is used for declarations of external functions or variables. pr_implement is used for definitions of external functions or variables. pr_callback is used for definitions and declarations of functions that are called via function pointers. a typical example is a function implemented in an application but called from a shared library. here are some simple examples of the use of these types: in dowhim.h: pr_extern( void ) dowhatimean( void ); static void pr_callback rootfunction(void *arg); in dowhim.c: pr_implement( void ) dowhatimean( void ) { return; }; prthread *thread = pr_createthread(..., rootfunction, ...); algebraic types nspr provides the following type definitions with unambiguous bit widths for alge...
PLHashEntry
...
PLHashTable
syntax #include <plhash.h> typedef struct plhashtable plhashtable; description the opaque plhashtable structure represents a hash table. entries in the table have the type plhashentry and are organized into buckets. the number of buckets in a hash table may be changed by the library functions during the lifetime of the table to optimize speed and space. a new hash table is created by the pl_newhashtable function, and destroyed by the pl_hashtabledestroy function. ...
PL_NewHashTable
fetime of the new hash table. allocpriv passed as the first argument (pool). returns the new hash table. description pl_newhashtable creates a new hash table. the table has at least 16 buckets. you can pass a value of 0 as numbuckets to create the default number of buckets in the new table. the arguments keycompare and valuecompare are functions of type plhashcomparator that the hash table library functions use to compare the keys and the values of entries. the argument allocops points to a plhashallocops structure that must exist throughout the lifetime of the new hash table. the hash table library functions do not make a copy of this structure. when the allocation functions in allocops are invoked, the allocation private data allocpriv is passed as the first argument (pool). you can spe...
PRNetAddr
of tcp or udp, in network byte order. ip the actual 32 (for inet.ip) or 128 (for ipv6.ip) bits of ip address. the inet.ip field is in network byte order. pad unused. flowinfo routing information. description the union prnetaddr represents a network address. nspr supports only the internet address family. by default, nspr is built to support only ipv4, but it's possible to build the nspr library to support both ipv4 and ipv6. therefore, the family field can be pr_af_inet only for default nspr, and can also be pr_af_inet6 if the binary supports ipv6. prnetaddr is binary-compatible with the socket address structures in the familiar berkeley socket interface, although this fact should not be relied upon. the raw member of the union is equivalent to struct sockaddr, the inet member is equiv...
PRStaticLinkTable
a static link table entry can be created by a client of the runtime so that other clients can access static or dynamic libraries transparently. the basic function on a dynamic library is to acquire a pointer to a function that the library exports. if, during initialization, such entries are manually created, then future attempts to link to the symbols can be treated in a consistent fashion. syntax #include <prlink.h> typedef struct prstaticlinktable { const char *name; void (*fp)(); } prstaticlinktable; ...
PR_EXTERN
syntax #include <prtypes.h> pr_extern(type)prototype description pr_extern is used to define externally visible routines and globals. for syntax details for each platform, see prtypes.h. the macro includes the proper specifications to declare the target extern and set up other required linkages. ...
PR_IMPLEMENT
syntax #include <prtypes.h> pr_implement(type)implementation description pr_implement is used to define implementations of externally visible routines and globals. for syntax details for each platform, see prtypes.h. ...
PR_Initialize
rms to standard c programming practice. argv the base address of an array of strings that compromise the program's argument vector. this approach conforms to standard c programming practice. maxptds this parameter is ignored. returns the value returned from the root function, prmain. description pr_initialize initializes the nspr runtime and places nspr between the caller and the runtime library. this allows main to be treated like any other function, signaling its completion by returning and allowing the runtime to coordinate the completion of the other threads of the runtime. pr_initialize does not return to its caller until all user threads have terminated. the priority of the main (or primordial) thread is pr_priority_normal. the thread may adjust its own priority by using pr_setth...
PR_NetAddrToString
d the converted string on output. size the size of the result buffer (string). returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. you can retrieve the reason for the failure by calling pr_geterror. description the network address to be converted (addr) may be either an ipv4 or ipv6 address structure, assuming that the nspr library and the host system are both configured to utilize ipv6 addressing. if addr is an ipv4 address, size needs to be at least 16. if addr is an ipv6 address, size needs to be at least 46. ...
PR_StringToNetAddr
owing values: if successful, pr_success. if unsuccessful, pr_failure. you can retrieve the reason for the failure by calling pr_geterror. description for ipv4 addresses, the input string represents numbers in the internet standard "." notation. ipv6 addresses are indicated as strings using ":" characters separating octets, with numerous caveats for shortcutting (see rfc #1884). if the nspr library and the host are configured to support ipv6, both formats are supported. otherwise, use of anything other than ipv4 dotted notation results in an error. ...
PR_VersionCheck
compares the version of nspr assumed by the caller (the imported version) with the version being offered by the runtime (the exported version). syntax #include <prinit.h> prbool pr_versioncheck(const char *importedversion); parameter pr_versioncheck has one parameter: importedversion the version of the shared library being imported. returns the function returns one of the following values: if the version of the shared library is compatible with that expected by the caller, pr_true. if the versions are not compatible, pr_false. description pr_versioncheck tests whether the version of the library being imported (importedversion) is compatible with the running version of the shared library. this is a string comparison of sorts, though the details of the comparison will vary over...
Process Initialization
this chapter describes the nspr api for versioning, process initialization, and shutdown of nspr. identity and versioning initialization and cleanup module initialization identity and versioning name and version constants pr_name pr_version pr_versioncheck initialization and cleanup nspr detects whether the library has been initialized and performs implicit initialization if it hasn't. implicit initialization should suffice unless a program has specific sequencing requirements or needs to characterize the primordial thread. explicit initialization is rarely necessary. implicit initialization assumes that the initiator is the primordial thread and that the thread is a user thread of normal priority. pr_init pr_initialize pr_initialized pr_cleanup pr_disableclockinterrupts ...
NSPR API Reference
r to string conversion pr_strtod pr_dtoa pr_cnvtf long long (64-bit) integers bitmaps formatted printing linked lists linked list types prclist linked list macros pr_init_clist pr_init_static_clist pr_append_link pr_insert_link pr_next_link pr_prev_link pr_remove_link pr_remove_and_init_link pr_insert_before pr_insert_after dynamic library linking library linking types prlibrary prstaticlinktable library linking functions pr_setlibrarypath pr_getlibrarypath pr_getlibraryname pr_freelibraryname pr_loadlibrary pr_unloadlibrary pr_findsymbol pr_findsymbolandlibrary finding symbols defined in the main executable program platform notes dynamic library search path exporting ...
Building NSS
please read these instructions carefully before attempting to build. build environment nss needs a c and c++ compiler. it has minimal dependencies, including only standard c and c++ libraries, plus zlib. for building, you also need make. ideally, also install gyp and ninja and put them on your path. this is recommended, as the build is faster and more reliable. windows nss compilation on windows uses the same shared build system as mozilla firefox. ...
NSS Code Coverage
4 - solaris/sparc platform results explanation files results from every c file are on new line. if file was tested, link points to annotated source file (in tcov directory), otherwise to original source file (cvs directory). colors green: 70-100% of blocks tested. yellow: 40-70% of blocks tested. orange: 0-40% of blocks tested. red: file not tested. file is not part of any binary or library used by test suite. numbers in tested files example: 72.69% (165/227/731) 72.69% - ratio of tested blocks and total blocks in file (generated by tcov). 165 - tested blocks in file (generated by tcov). 227 - total blocks in file (generated by tcov). 31 - total lines in file (by wc -l command). numbers in not tested files example: not tested (0/?/878). 0 - tested blocks in file (alway...
NSS FAQ
Mozilla › Projects › NSS › FAQ
hat need to communicate with the many clients and servers that already support the ssl protocol. the pkcs #11 interface included in nss means that your application can use hardware accelerators on the server and smart cards for two-factor authentication. how does nss compare to openssl? openssl is an open source project that implements server-side ssl, tls, and a general-purpose cryptography library. it does not support pkcs #11. it is based on the ssleay library developed by eric a. young and tim j. hudson. openssl is widely used in apache servers and is licensed under an apache-style licence. nss supports both server and client applications as well as pkcs #11 and s/mime. to permit its use in as many contexts as possible, nss is licensed under the mozilla public license, version 2. how ...
FIPS Mode - an explanation
may be found on support.mozilla.com. is nss fips-140 compliant? mozilla's nss cryptographic software has been tested by government-approved independent testing labs and certified by nist as being fips 140 compliant when operated in fips mode on 4 previous occasions. as of this writing, nss is now being retested to be recertified for the fifth time. nss was the first open source cryptographic library to be fips certified. what is fips mode all about? a fips-140 compliant application must do all of its cryptography in a fips-140 certified "device". whether it is hardware or software, that device will have all the cryptographic engines in it, and also will stores keys and perhaps certificates inside. the device must have a way for users to authenticate to it (to "login" to it), to prove ...
Getting Started With NSS
how to get involved with nss network security services (nss) is a base library for cryptographic algorithms and secure network protocols used by mozilla software. would you like to get involved and help us to improve the core security of mozilla firefox and other applications that make use of nss? we are looking forward to your contributions! we have a large list of tasks waiting for attention, and we are happy to assist you in identifying areas that match your interest or skills. you can find us on mozilla irc in channel #nss or you could ask your questions on the mozilla.dev.tech.crypto newsgroup. the nss library and its supporting command line tools are written in the c programming language. its build system and the automated tests are based on makefiles and bash scripts. over tim...
HTTP delegation
uerying an oscp responder. this nss feature is currently targeted to first appear in nss version 3.11.1. more details can be found in bug 152426. in order to use the http delegation feature in your nss-based application, you need to implement several callback functions. your callback functions might be a full implementation of a http client. or you might choose to leverage an existing http client library and implement the callback functions as a thin layer that forwards requests from nss to the http client library. to learn about all the details, please read the documentation contained in the nss c header files. look for function sec_registerdefaulthttpclient and all functions having names that start with sec_http. to find an example implementation, you may look at bug 111384, which tracks the im...
HTTP delegation
uerying an oscp responder. this nss feature is currently targeted to first appear in nss version 3.11.1. more details can be found in bug 152426. in order to use the http delegation feature in your nss-based application, you need to implement several callback functions. your callback functions might be a full implementation of a http client. or you might choose to leverage an existing http client library and implement the callback functions as a thin layer that forwards requests from nss to the http client library. to learn about all the details, please read the documentation contained in the nss c header files. look for function sec_registerdefaulthttpclient and all functions having names that start with sec_http. to find an example implementation, you may look at bug 111384, which tracks the im...
Build instructions for JSS 4.3.x
r contributed instructions. build jss. cd mozilla/security/jss gmake sign the jss jar. if you're intention is to modify and build the jss source you need to apply for your own jce code-signing certificate if you made no changes and your goal is to build jss you can use the signed binary release of the jss4.jar from ftp.mozilla.org. with your built jss4 jni shared library. next, you should read the instructions on using jss. ...
JSS FAQ
Mozilla › Projects › NSS › JSS › JSS FAQ
ier version of the jdk then you will also have to install jce 1.2.1. see also the document using jss. does jss have 64 bit support? yes, jss 3.2 and higher supports 64 bit. you will need jdk 1.4 or higher and all the 64 bit versions of nspr, and nss. as well you must use the java flag -d64 to specify the 64-bit data model. is jss fips compliant? nss is a fips-certified software library. jss is considered a fips-compliant software library since it only uses nss for any and all crypto routines. is there any sample code and documentation? the using jss document describes how to set up your environment to run jss. the only other documentation is the javadoc. jss example code is essentially developer test code; with that understanding, the best directory to look for sam...
JSS
Mozilla › Projects › NSS › JSS
pports most of the security standards and encryption technologies supported by nss. jss also provides a pure java interface for asn.1 types and ber/der encoding. jss offers a implementation of java ssl sockets that uses nss's ssl/tls implementation rather than sun's jsse implementation. you might want to use jss's own ssl classes if you want to use some of the capabilities found in nss's ssl/tls library but not found in jsse. nss is the cryptographic module where all cryptographic operations are performed. jss essentially provides a java jni bridge to nss c shared libraries. when nss is put in fips mode, jss ensures fips compliance by ensuring that all cryptographic operations are performed by the nss cryptographic module. jss offers a jce provider, "mozilla-jss" jca provider notes. jss, jss4...
NSS_3.12.1_release_notes.html
lude - nss header files lib - nss shared libraries bin - nss tools and test programs you also need to download the nspr 4.7.1 binary distributions to get the nspr 4.7.1 header files and shared libraries, which nss 3.12.1 requires. nspr 4.7.1 binary distributions are in https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.7.1/. new in nss 3.12.1 new functions in the nss shared library: cert_nametoasciiinvertible (see cert.h) convert an certname into its rfc1485 encoded equivalent. returns a string that must be freed with port_free(). caller chooses encoding rules. cert_encodesubjectkeyid (see cert.h) encode certificate skid (subject key id) extension. pk11_getallslotsforcert (see pk11pub.h) pk11_getallslotsforcert returns all the slots that a given certificate exists on, sin...
NSS_3.12.2_release_notes.html
ude - nss header files lib - nss shared libraries bin< - nss tools and test programs you also need to download the nspr 4.7.1 binary distributions to get the nspr 4.7.1 header files and shared libraries, which nss 3.12.2 requires. nspr 4.7.1 binary distributions are in https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.7.1/. new in nss 3.12.2 new functions in the nss shared library: sec_pkcs12addcertorchainandkey (see p12.h) new pkcs11 errors (see secerr.h) sec_error_pkcs11_general_error sec_error_pkcs11_function_failed sec_error_pkcs11_device_error bugs fixed the following bugs have been fixed in nss 3.12.2. bug 200704: pkcs11: invalid session handle 0 bug 205434: fully implement new libpkix cert verification api from bug 294531 bug 302670: use the instal...
NSS 3.12.5 release_notes
string parameter is null (as opposed to empty, zero length), then the softoken default is used. these are equivalent to the parameters for pk11_configurepkcs11(). see the following struct in nss.h for details: nssinitparametersstr other new functions in secmod.h: secmod_getskipfirstflag secmod_getdefaultmoddbflag in prlink.h nss_securememcmp port_loadlibraryfromorigin modified functions sgn_update (see cryptohi.h) the parameter "input" of this function is changed from unsigned char * to const unsigned char *. pk11_configurepkcs11 (see nss.h) the name of some parameters have been slightly changed ("des" became "desc"). deprecated headers the header file key.h is deprecated. please use keyhi.h instead. addi...
NSS 3.12.6 release notes
bug 527759: add multiple roots to nss (single patch) bug 528741: pkix_hash throws a null-argument exception on empty strings ...
NSS 3.14.2 release notes
ozilla.org/show_bug.cgi?id=805604 and https://crypto.stanford.edu/realworldcrypto/slides/gueron.pdf). support for other platforms, such as windows, will follow in a future nss release. (https://bugzilla.mozilla.org/show_bug.cgi?id=540986) sqlite has been updated to 3.7.15. note: please apply the patch in https://bugzilla.mozilla.org/show_bug.cgi?id=837799 if you build nss with the system sqlite library and your system sqlite library is older than 3.7.15. bug 816853 - when using libpkix for certificate validation, applications may now supply additional application-defined trust anchors to be used in addition to those from loaded security tokens, rather than as an alternative to. (https://bugzilla.mozilla.org/show_bug.cgi?id=816853) bug 772144 - basic support for running nss test suites on an...
NSS 3.15.1 release notes
and rfc 5289) are supported, allowing tls to be used without md5 and sha-1. note the following limitations. the hash function used in the signature for tls 1.2 client authentication must be the hash function of the tls 1.2 prf, which is always sha-256 in nss 3.15.1. aes gcm cipher suites are not yet supported. new functions none. new types in sslprot.h ssl_library_version_tls_1_2 - the protocol version of tls 1.2 on the wire, value 0x0303. tls_dhe_rsa_with_aes_256_cbc_sha256, tls_rsa_with_aes_256_cbc_sha256, tls_ecdhe_ecdsa_with_aes_128_cbc_sha256, tls_ecdhe_rsa_with_aes_128_cbc_sha256, tls_dhe_rsa_with_aes_128_cbc_sha256, tls_rsa_with_aes_128_cbc_sha256, tls_rsa_with_null_sha256 - new tls 1.2 only hmac-sha256 cipher suites. in sslerr.h ...
NSS 3.15 release notes
propriate calls to ssl_peerstapledocspresponse and cert_cacheocspresponsefromsidechannel. bug 554369: fixed correctness of cert_cacheocspresponsefromsidechannel and other ocsp caching behaviour. bug 853285: fixed bugs in aes gcm. bug 341127: fix the invalid read in rc4_wordconv. faster nist curve p-256 implementation. dropped (32-bit) sparc v8 processor support on solaris. the shared library libfreebl_32int_3.so is no longer produced. bugs fixed in nss 3.15 this bugzilla query returns all the bugs fixed in nss 3.15: https://bugzilla.mozilla.org/buglist.cgi?list_id=6278317&resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.15 ...
NSS 3.17 release notes
lient code, which always generates a fresh ephemeral ecdh key for each handshake. new macros in ssl.h ssl_reuse_server_ecdhe_key notable changes in nss 3.17 the manual pages for the certutil and pp tools have been updated to document the new parameters that had been added in nss 3.16.2. on windows, the new build variable use_static_rtl can be used to specify the static c runtime library should be used. by default the dynamic c runtime library is used. bugs fixed in nss 3.17 this bugzilla query returns all the bugs fixed in nss 3.17: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.17 ...
NSS 3.19 release notes
s 3.19 new functionality for some certificates, such as root ca certificates that don't embed any constraints, nss might impose additional constraints such as name constraints. a new api (cert_getimposednameconstraints) has been added that allows one to lookup imposed constraints. it is possible to override the directory (sqlite_lib_dir) in which the nss build system will look for the sqlite library. new functions in cert.h cert_getimposednameconstraints - check if any imposed constraints exist for the given certificate, and if found, return the constraints as encoded certificate extensions. notable changes in nss 3.19 the ssl 3 protocol has been disabled by default. nss now more strictly validates tls extensions and will fail a handshake that contains malformed extens...
NSS 3.21 release notes
l_signatureprefset - configures the enabled signature and hash algorithms for tls ssl_signatureprefget - retrieves the currently configured signature and hash algorithms ssl_signaturemaxcount - obtains the maximum number signature algorithms that can be configured with ssl_signatureprefset in utilpars.h nssutil_argparsemodulespecex - takes a module spec and breaks it into shared library string, module name string, module parameters string, nss specific parameters string, and nss configuration parameter strings. the returned strings must be freed by the caller. the difference with nss_argparsemodulespec is the new function handles nss configuration parameter strings. nssutil_mkmodulespecex - take a shared library string, module name string, module parameters string, nss specif...
NSS 3.26 release notes
/mozilla.org/security/nss/releases/nss_3_26_rtm/src/ new in nss 3.26 new functionality the selfserv test utility has been enhanced to support alpn (http/1.1) and 0-rtt added support for the system-wide crypto policy available on fedora linux, see http://fedoraproject.org/wiki/changes/cryptopolicy introduced build flag nss_disable_libpkix which allows compilation of nss without the libpkix library notable changes in nss 3.26 the following ca certificate was added cn = isrg root x1 sha-256 fingerprint: 96:bc:ec:06:26:49:76:f3:74:60:77:9a:cf:28:c5:a7:cf:e8:a3:c0:aa:e1:1a:8f:fc:ee:05:c0:bd:df:08:c6 npn is disabled, and alpn is enabled by default the nss test suite now completes with the experimental tls 1.3 code enabled several test improvements and addi...
NSS 3.27.1 release notes
n re-disabled in the default build. previous versions of nss made tls 1.3 (draft) available only when compiled with nss_enable_tls_1_3. nss 3.27 set this value on by default, allowing tls 1.3 (draft) to be disabled using nss_disable_tls_1_3, although the maximum version used by default remained tls 1.2. however, some applications query the list of protocol versions that are supported by the nss library, enabling all supported tls protocol versions. because nss 3.27 enabled compilation of tls 1.3 (draft) by default, it caused those applications to enable tls 1.3 (draft). this resulted in connectivity failures, as some tls servers are version 1.3 intolerant, and failed to negotiate an earlier tls version with nss 3.27 clients. nss 3.27.1 once again requires nss_enable_tls_1_3 to be deliberately ...
NSS 3.28.3 release notes
directly, or indirectly through ecpublickey, ecprivatekey, nsslowkeypublickey, nsslowkeyprivatekey, or potentially other data structures that reference ecparams. the change has been reverted to the original state in bug 1334108. seckeyecpublickey had been extended with a new attribute, named "encoding". if an application passed type seckeyecpublickey to nss (as part of seckeypublickey), the nss library read the uninitialized attribute. with this nss release seckeyecpublickey.encoding is deprecated. nss no longer reads the attribute, and will always set it to ecpoint_undefined. see bug 1340103. compatibility nss 3.28.3 shared libraries are backward compatible with most older nss 3.x shared libraries, but depending on your application, may be incompatible, if you application has been compiled a...
NSS 3.29.1 release notes
directly, or indirectly through ecpublickey, ecprivatekey, nsslowkeypublickey, nsslowkeyprivatekey, or potentially other data structures that reference ecparams. the change has been reverted to the original state in bug 1334108. seckeyecpublickey had been extended with a new attribute, named "encoding". if an application passed type seckeyecpublickey to nss (as part of seckeypublickey), the nss library read the uninitialized attribute. with this nss release seckeyecpublickey.encoding is deprecated. nss no longer reads the attribute, and will always set it to ecpoint_undefined. see bug 1340103. note that nss 3.28.3 from the older nss 3.28.x branch has also been released with the identical fixes. compatibility nss 3.29.1 shared libraries are backward compatible with most older nss 3.x shared l...
NSS 3.31 release notes
pattr_ for path attributes defined in rfc7512. several new macros that start with pk11uri_qattr_ for query attributes defined in rfc7512. notable changes in nss 3.31 the apis that set a tls version range have been changed to trim the requested range to the overlap with a systemwide crypto policy, if configured. ssl_versionrangegetsupported can be used to query the overlap between the library's supported range of tls versions and the systemwide policy. previously, ssl_versionrangeset and ssl_versionrangesetdefault returned a failure if the requested version range wasn't fully allowed by the systemwide crypto policy. they have been changed to return success, if at least one tls version overlaps between the requested range and the systemwide policy. an application may call ssl_versionr...
NSS 3.48 release notes
because using an iteration count higher than 1 with the legacy dbm (key3.db) storage creates files that are incompatible with previous versions of nss, applications that wish to enable it for key3.db are required to set environment variable nss_allow_legacy_dbm_iteration_count=1. applications may set environment variable nss_min_mp_pbe_iteration_count to request a higher iteration count than the library's default, or nss_max_mp_pbe_iteration_count to request a lower iteration count for test environments. see bug 1562671 for details. certificate authority changes the following ca certificates were added: bug 1591178 - entrust root certification authority - g4 cert sha-256 fingerprint: db3517d1f6732a2d5ab97c533ec70779ee3270a62fb4ac4238372460e6f01e88 upcoming c...
NSS Sample Code Sample1
s should not be used. use the rsa-based wrapping // methods instead. int server::rawexportkey(pk11symkey *key, secitem **res) { int rv = 0; secitem *data; secstatus s; s = pk11_extractkeyvalue(key); if (s != secsuccess) { rv = 1; goto done; } data = pk11_getkeydata(key); *res = secitem_dupitem(data); if (!*res) { rv = 1; goto done; } done: return rv; } // initialize the nss library. normally this // would be done as part of each server's startup. // however, this example uses the same databases // to store keys for server in the "cluster" so // it is done once. int initnss() { int rv = 0; secstatus s; s = nss_initreadwrite("."); if (s != secsuccess) rv = 1; // error // for this example, we don't use database passwords pk11_initpin(pk11_getinternalkeyslot(), "...
NSS Sample Code Utilities_1
nss sample code common: utilities this is a library of utilities used by many of the samples. this code shows the following: extract seed from noise file read der encoding from a file extract the password from a text file get the module password print as ascii or hexadecimal sample code #include <prlog.h> #include <termios.h> #include <base64.h> #include <unistd.h> #include <sys/stat.h> #include <prprf.h> #include "util.h" /* * these utility functions are adapted from those found in * the sectool library used by the nss security tools and * other nss test applications. */ /* * newline */ static void newline(prfiledesc* out) { pr_fprintf(out, "\n"); } /* * printasascii */ void printasascii(prfiledesc* out, const unsigned char *data, unsigned int len) { char ...
Build instructions
ue target1 target2 or defined in the environment, e.g. (for posix shells), variable=value; export variable gmake target1 target2 here are some (not all) of the make variables that affect nss builds: build_opt: if set to 1, means do optimized non-debug build. default is debug, non-optimized build. use_debug_rtl: if set to 1, on windows, causes build with debug version of the c run-time library. ns_use_gcc: on platforms where gcc is not the native compiler, tells nss to build with gcc instead of the native compiler. default is to build with the native compiler. use_64: on platforms that support both 32-bit and 64-bit abis, tells nss to build for the 64-bit abi. default is 32-bit abi, except on platforms that do not support a 32-bit abi. moz_debug_symbols: tells nss to build with debu...
FC_Finalize
name fc_finalize - indicate that an application is done with the pkcs #11 library. syntax ck_rv fc_finalize (ck_void_ptr preserved); parameters fc_finalize has one parameter: preserved must be null description fc_finalize shuts down the nss cryptographic module in the fips mode of operation. if the library is not initialized, it does nothing. the preserved argument is not used and must be null. return value fc_finalize always returns ckr_ok. fc_finalize should check the preserved argument and return ckr_arguments_bad if preserved is not null. fc_finalize should return ckr_cryptoki_not_initialized if the library is not initialized. examples #include <assert.h> ck_function_list_ptr pfunctionlist; ck_rv crv; crv = fc_getfunctionlist(&pfunctionlist); assert(crv == ckr...
FC_GetTokenInfo
8.3 (major=0x08, minor=0x03), which are the version numbers of the certificate and key databases, respectively. firmwareversion: firmware version number, 0.0 (major=0x00, minor=0x00). a user may call fc_gettokeninfo without logging into the token (to assume the nss user role). return value ckr_ok token information was successfully copied. ckr_cryptoki_not_initialized the pkcs #11 module library is not initialized. ckr_slot_id_invalid the specified slot number is out of the defined range of values. fc_gettokeninfo should return ckr_arguments_bad if pinfo is null. examples note the use of the %.32s format string to print the label and manufacturerid members of the ck_token_info structure. see also fc_getslotinfo, nsc_gettokeninfo ...
NSS tools : vfychain
the tasks associated with security module database management are part of a process that typically also involves managing key databases and certificate databases. options -a the following certfile is base64 encoded -b yymmddhhmmz validate date (default: now) -d directory database directory -f enable cert fetching from aia url -o oid set policy oid for cert validation(format oid.1.2.3) -p use pkix library to validate certificate by calling: * cert_verifycertificate if specified once, * cert_pkixverifycert if specified twice and more. -r following certfile is raw binary der (default) -t following cert is explicitly trusted (overrides db trust) -u usage 0=ssl client, 1=ssl server, 2=ssl stepup, 3=ssl ca, 4=email signer, 5=email recipient, 6=object signer, 9=protectedobjectsigner, 10=ocsp responder, ...
NSS tools : vfychain
lly also involves managing key databases and certificate databases. options -a the following certfile is base64 encoded -b yymmddhhmmz validate date (default: now) -d directory database directory -f enable cert fetching from aia url -o oid set policy oid for cert validation(format oid.1.2.3) -p use pkix library to validate certificate by calling: * cert_verifycertificate if specified once, * cert_pkixverifycert if specified twice and more. -r following certfile is raw binary der (default) -t following cert is explicitly trusted (overrides db trust) -u usage 0=ssl client, 1=ssl server, 2=ssl stepup, 3=ssl ca, 4=email signer,...
Network Security Services
nss developer tutorial how to make changes in nss. coding style, maintaining abi compatibility. nss tools tools for developing, debugging, and managing applications that use nss. sample code demonstrates how nss can be used for cryptographic operations, certificate handling, ssl, etc. third-party code a list of third-party code included in the nss library. nss 3.2 test suite archived version. describes how to run the standard nss tests. nss performance reports archived version. links to performance reports for nss 3.2 and later releases. encryption technologies available in nss 3.11 archived version. lists the cryptographic algorithms used by nss 3.11. nss 3.1 loadable root certificates archived version. des...
Necko Architecture
necko has been designed to accommodate pluggable protocols so developers can contribute their own protocol libraries that can be dynamically loaded and used by applications utilizing necko. necko provides the following libraries: necko - core networking functionality. ...
Necko FAQ
everything you wanted to know about the networking library in mozilla... and did ask. what is necko? a word rhyming with gecko and starting with the same letters as networking. that's all! any resemblance in flavor to the necco candy is purely coincidental. what do i need to build this library? see the code section on the main page. currently you'd need to get the mozilla tree and at least build nspr, and xpcom. todo put links! how does psm fit into this picture? todo how does the proxy support work? todo what about proxy auto config? todo what about socks support? todo when is the next stable release of this library going to be available? todo i'd like to use this library for my project. what licences apply? todo - mpl what do the page load options mean in the p...
Necko
necko is a network library that provides a platform-independent api for several layers of networking, ranging from transport to presentation layers. this api is used in many mozilla-based client applications (including firefox) and can be used for writing other networking clients. currently the library is built as part of the mozilla distribution. you can get the whole distribution as described in the build documentation. eventually we'd like to move to a binary distribution mechanism for the networking library so that you can build your application that uses this library without having to build mozilla. browse our code in its latest state at netwerk/ documents a necko code walkthrough necko architecture necko multithreading necko faq necko interfaces overview the necko http mo...
Rhino downloads archive
-02-10 changes in 1.5r4 rhino15r4.zip rhino 1.5r3 2002-01-27 changes in 1.5r3 rhino15r3.zip rhino 1.5r2 2001-07-27 changes in 1.5r2 rhino15r2.zip rhino 1.5r1 2000-09-10 changes in 1.5r1 rhino15r1.zip rhino 1.4r3 1999-05-10 initial public release rhino14r3.zip rhino 1.6r1 through 1.6r6 implement e4x using xmlbeans library. if you would like to use e4x you need to add xbean.jar from xmlbeans distribution to your class path. in rhino 1.6r6 and later the e4x support has been rewritten to rely solely on the dom3 apis supported natively by java 1.5. (pre-java 1.5 users can use dom3 using java's endorsed standards override mechanism if they have a dom3-capable xml parser.) if neither xmlbeans nor dom3 are present, e4x i...
Rhino FAQ
however, a java-based browser may use rhino with scripts from a page in the same manner that any other java program would. ...
Scripting Java
this article shows how to use rhino to reach beyond javascript into java. scripting java has many uses. it allows us to write powerful scripts quickly by making use of the many java libraries available. we can test java classes by writing scripts. we can also aid our java development by using scripting for exploratory programming. exploratory programming is the process of learning about what a library or api can do by writing quick programs that use it. as we will see, scripting makes this process easier. note that the ecma standard doesn't cover communication with java (or with any external object system for that matter). all the functionality covered in this chapter should thus be considered an extension. accessing java packages and classes every piece of java code is part of a class. eve...
Future directions
e it helps the spec work. for these features: do not add vendor prefixes. see http://hsivonen.iki.fi/vendor-prefixes/ for an extended argument. disable the feature before the beta channel. nightly and aurora are the good channels for experimental work. nspr the plan is to make spidermonkey not depend on nspr. no fundamental blockers currently exist, but ctypes is still using nspr's runtime library loading facilities. directories and filenames see https://wiki.mozilla.org/js_engine_modularization. ...
JSFreeOp
ntext. syntax jsfreeop(jsruntime *rt); name type description rt jsruntime * a runtime to store in this structure. methods method description jsruntime *runtime() const returns a pointer to jsruntime passed to constructor. description various finalization api takes not jscontext * but rather either jsfreeop structure or its library-private counterpart freeop. these structures wrap parameters that are passed to the finalizers removing most of explicit dependencies on jscontext in the finalization code. see also mxr id search for jsfreeop js_freeop js_getdefaultfreeop jsfinalizecallback jsdestroycompartmentcallback bug 737365 ...
JS_GetParent
jsobject * object for which to retrieve the parent. description js_getparent retrieves the parent object of obj, or null if obj does not have a parent. warning: the result may be an internal-use-only object. such an object should not be passed to any other jsapi function that could expose it to script code. each object is assigned a parent when it is created: the standard library objects and functions all have the global object as their parent. objects created by standard library functions, such as array.prototype.concat, have the global object as their parent. an object created by a script via the new keyword has the same parent as the constructor. for example, after d = new date, d has the same parent as date, ordinarily the global object. an object created by a scr...
Parser API
bjects the optional builder parameter to reflect.parse() makes it possible to construct user-specified data from the parser, rather than the default node objects. builder objects may contain any of the callback methods described in this section. each callback can produce any custom, user-defined datatype; these are referred to below as customexpression, customstatement, etc. note: because this library uses null for optional nodes, it is recommended that user-defined datatypes not use null as a representation of an ast node. if the loc option is enabled (see the reflect.parse() options above), then each callback is provided with the source location information of the parsed node as an extra parameter. all builder callbacks are optional. when a callback is missing, the default format is used, ...
Profiling SpiderMonkey
ble-shark ac_add_options --enable-debugger-info-modules ac_add_options --enable-application=browser 2.) you'll want to run shark on both the browser and [xpcshell], since the host environments differ. here are some instrumented tests to work from: media:profiling-ammo.zip 3.) once you have some changes you'd like to try, you can just rebuild the js/src directory, since it produces its own shared library, even in libxul and static builds. make -c my-obj-dir/js/src other ways to profile for linux, there are global jprof functions available. see the documentation on the --enable-jprof mozconfig option. we're working to add support for other profilers, such as oprofile, intel vtune, and callgrind. when we have js scriptable profiling options available for all tier 1 platforms, we'll look at adding ...
SpiderMonkey 1.8.5
this versioning scheme will not be rolled back into the upstream mozilla source tree(s), and may not be used in future source releases. comments in bug 628723 with regard to its usefulness are appreciated. bugs with the source release tar ball should be copied to wes@page.ca. spidermonkey embedders should also be aware that mozilla has no plans to keep the jsapi, nor the jsdb...
SpiderMonkey 1.8.7
this versioning scheme will not be rolled back into the upstream mozilla source tree(s), and may not be used in future source releases. comments in bug 628723 with regard to its usefulness are appreciated. bugs with the source release tar ball should be copied to wes@page.ca. spidermonkey embedders should also be aware that mozilla has no plans to keep the jsapi, nor the jsdb...
SpiderMonkey 1.8.8
ntext* parameters to many methods the js_getclass method now takes only a jsobject*, where previously it also required a jscontext* in threadsafe builds. (the js_get_class macro abstracting away this difference has accordingly been removed.) javascript shell changes detail added/removed methods here... known issues detail any known issues here... future direction include-followup-on-experimental-library-versioning-scheme-here spidermonkey embedders should also be aware that mozilla has no plans to keep the jsapi, nor the jsdbgapi stable for embedders. we have chosen to concentrate on performance and correctness as primary concerns instead. the team is considering the removal of tinyids js_threadsafe is going away, with future versions supporting only thread-safe builds a new debugging api i...
SpiderMonkey 17
rdingly been removed.) garbage collection functions now take runtime argument most garbage collection functions now take a runtime argument instead of a context. the one exception to this is js_maybegc which still takes a context as argument. javascript shell changes detail added/removed methods here... known issues detail any known issues here... future direction include-followup-on-experimental-library-versioning-scheme-here spidermonkey embedders should also be aware that mozilla has no plans to keep the jsapi, nor the jsdbgapi stable for embedders. we have chosen to concentrate on performance and correctness as primary concerns instead. the team is considering the removal of tinyids js_threadsafe is going away, with future versions supporting only thread-safe builds a new debugging api i...
SpiderMonkey 31
initialize the js engine before any jsruntimes are created or other jsapi methods are called. this method pairs with the existing (currently non-mandatory) js_shutdown method, which uninitializes the js engine after all runtimes have been destroyed. js_seticumemoryfunctions is a new function which can be used to set the allocation and deallocation functions used by the icu internationalization library. this is unlikely to be of interest to embedders unless you are doing detailed memory profiling. it must be called before js_init is called. obsolete apis js_convertarguments "j" type deleted apis js_newgrowablestring (can be replaced with js_newucstring) js_isconstructing (can be replaced with callargs::isconstructing or callreceiver::isconstructing) js_valuetoboolean (replaced by ...
Mozilla Projects
g platform is done in many different ways. the various checks needed lead to a lot of copy+pasting, leaving the reader to wonder....is this specific check necessary for (e.g.) an operating system? because information is not consolidated, checks are not done consistently, nor is it defined what we are checking for. necko necko is a network library that provides a platform-independent api for several layers of networking, ranging from transport to presentation layers. this api is used in many mozilla-based client applications (including firefox) and can be used for writing other networking clients. network security services network security services (nss) is a set of libraries desig...
Life After XUL: Building Firefox Interfaces with HTML
of how to replace xul is ongoing within the platform team. ...
Using the Places favicon service
ibed in more detail in using the places annotation service. you should always use nsifaviconservice.getfaviconimageforpage() to get the favicon for a page. if the page has no favicon, or we have never heard of the page, this function will return a "chrome:" uri of the default favicon. this allows efficient caching, since the default favicon will probably be cached in its decoded form by the image library. if there is an error loading the favicon for an annotation uri, the default favicon data will be returned by the annotation service's protocol handler. however, since the uri will be different from the default favicon, the decoded image will not be cached by the image library. see also nsifaviconservice ...
Places
querying places how to query the bookmarks and history system with specific parameters. retrieving part of the bookmarks tree how to fetch a section of the bookmarks tree using queries. displaying places information using views how to use places views to display places data in your own applications or extensions. places utilities for javascript a library of convenient routines that make it easier to work with places. places database troubleshooting how to deal with a corrupt places.sqlite database. view all... design documents the places database high-level overview of the places database design. history service design design of the history service. the places "frecency" algorithm ...
The Publicity Stream API
la-hosted activity stream generated by a user's application usage. the publicity stream is provided as a central place for applications to publicize application usage for the purpose of notifying a user's friends of the applications which their friends are using. it is not meant as a general application messaging system. accessing the api the publicity api can be enabled by including a javascript library. this library will detect whether native api support is enabled by the user's browser, if not it will shim in a pure html implementation. [is this still doable?] the javascript library should be included from: https://myapps.mozillalabs.com/jsapi/publicity.js all apis related to open web applications are accessed under the navigator.apps object. publicity stream api (navigator.apps.publicity.*) t...
FUEL
fuel is deprecated as of firefox 40 and removed as of firefox 47. consider using the add-ons sdk instead fuel is a javascript library designed to help developers build extensions using terminology and interfaces that are familiar to them. fuel is new in firefox 3. fuel is about making it easier for extension developers to be productive, by minimizing some of the xpcom formality and adding some "modern" javascript ideas. we want to start with areas that will provide the most benefit. fuel has a fueliapplication interface that implements all the functions of extiapplication. the library has also been implemented in thunderbird ("steel") and in seamonkey ("smile"). objects extiapplication objects extiapplication exticonsole extieventitem extieventlistener extievents extiexte...
SMILE
this article covers features introduced in seamonkey 2 smile is a javascript library designed to help developers build extensions using terminology and interfaces that are familiar to them. smile is about making it easier for extension developers to be productive, by minimizing some of the xpcom formality and adding some "modern" javascript ideas. we want to start with areas that will provide the most benefit. smile has a smileiapplication interface that implements all the functions of extiapplication. the library has also been implemented in firefox ("fuel") and in thunderbird ("steel"). objects extiapplication objects exticonsole extieventitem extieventlistener extievents extiextension extiextensions extipreference extipreferencebranch extisessionstorage smileiappli...
STEEL
steel is deprecated and will be removed as of thunderbird 52. consider using the functions found in appconstants.jsm or services.jsm instead steel is the scriptable thunderbird easy extension library. it is a fuel-like set of interfaces to facilitate thunderbird extension development. currently, steel has an steeliapplication interface that implements all the functions of extiapplication. the library has also been implemented in firefox ("fuel") and in seamonkey ("smile"). objects extiapplication objects extiapplication exticonsole extieventitem extieventlistener extievents extiextension extiextensions extipreference extipreferencebranch extisessionstorage steeliapplication objects steeliapplication xpcom although the steel steeliapplication object is preloaded i...
Bundling multiple binary components
ponents support multiple version of gecko: dynamic method loading stub loader dynamic method loading the idea with this approach is to figure out all the methods imported from gecko and dynamically load the methods. create small wrappers for calling the methods, as you may need to thunk parameters depending on how much has changed between gecko versions. this means using something like loadlibrary / getprocaddress / freelibrary on windows. actually, nspr has portable versions of those features that work across platforms. this approach uses only one binary for each platform (win/mac/linux) but creates complexity in the binaries - loading the methods and creating the wrappers. the costs get higher if you have many methods that need to be loaded. stub loader this approach involves using a ...
Creating a Python XPCOM component
thon using pyxpcom. (note that some details may be missing.) preparation if a binary of pyxpcom is not available, you will need to build it - see building pyxpcom. tip: you can achieve a copy of binary of pyxpcom from pythonext; simply unpack xpi and take everything you need. if you wish to use pyxpcom from a normal python executable, you will need to tell python where it can find the pyxpcom library. this is probably best done by setting a pythonpath variable pointing at the 'bin/python' directory in the application. this is not necessary when your components are loaded by mozilla as the python loader modifies sys.path. then you can import xpcom in any python module (mostly, in your component). defining the interface make a file named "nsipysimple.idl" to define the interface: #include "nsi...
XPCOM Glue without mozalloc
infallible memory allocation routines (mozalloc). since these routines didn't exist prior to xulrunner 2.0, xpcom components that link against the frozen linkage dependent glue will not be compatible with xulrunner applications prior to 2.0. the solution is to link against xpcomglue_s_nomozalloc instead (xpcomglue_s_nomozalloc.lib on windows, libxpcomglue_s_nomozalloc.a on linux and mac). this library is new in xulrunner 2.0, and it's identical to xpcomglue_s, except that it's compiled without mozalloc. simply change all references to "xpcomglue_s" in your compiler and linker flags to "xpcomglue_s_nomozalloc". resulting xpcom components will no longer have a dependency on mozalloc, and will thus be compatible with xulrunner applications prior to 2.0 as well. comment: you might also need to b...
Packaging WebLock
the first section, component installation overview, describes the general installation process in mozilla. the following sections describe the steps you can take to organize the weblock component for distribution and installation. note: the emphasis of this tutorial is on the component development itself, so this section on packaging and installing extensions to gecko is necessarily brief. ...
Resources
oper. ...
Using XPCOM Components
nt object and pass in the contract id for the component you want and ask for either a singleton or an instance of that component to be returned: var cmgr = components.classes["@mozilla.org/cookiemanager;1"] .getservice(); the resulting cookiemanager object then provides access to all of the methods for that component that have been defined in idl and compiled into the type library. using the cookiemanager component, you could write code like this to delete all cookies from the system: cmgr = components.classes["@mozilla.org/cookiemanager;1"] .getservice(); cmgr = cmgr.queryinterface(components.interfaces.nsicookiemanager); // delete all cookies function trashem() { cmgr.removeall(); } another vital feature of the xpconnect glue this example shows is...
Creating XPCOM components
ind component the weblock component component use in mozilla finding mozilla components using xpcom components in your cpp xpconnect: using xpcom components from script component internals creating components in cpp xpcom initialization xpcom registry manifests registration methods in xpcom autoregistration the shutdown process three parts of a xpcom component library xpcom glue the glue library xpcom string classes creating the component code what we'll be working on component registration the regxpcom program registration alternatives overview of the weblock module source digging in: required includes and constants identifiers in xpcom coding for the registration process the registration methods creating an instance...
Components.utils.Sandbox
rt objects or values. freeing the sandbox when you have finished using a sandbox, it should be freed to avoid memory leaks. generally the javascript garbage collector will take care of this when there are no remaining references to the sandbox or the code it contains. however, in some cases it can be difficult to remove all references. for example, the code in the sandbox might be a third-party library that sets expando properties or adds event listeners to a window. in this case, components.utils.nukesandbox can be used to force the sandbox to be freed immediately. example executing in current tab scope more ways to load scripts into a sandbox can be found on the loading scripts page. this example is to be run from scratchpad with environemnt set to browser. it alerts the dollar sign funct...
Core XPCOM functions
xpcom provides a number of global functions which are used to initialize and shut down the xpcom library, as well as to allocate memory, get access to services, and to instantiate interfaces. ns_allocinfallibly allocates a block of memory using the xpcom memory manager.ns_freefrees a block of memory using the xpcom memory manager.ns_getcomponentmanagerthe ns_getcomponentmanager function returns a reference to the xpcom component manager.ns_getcomponentregistrarthe ns_getcomponentregistrar function returns a reference to the xpcom component registrar.ns_getmemorymanagerthe ns_getmemorymanager function returns a reference to the xpcom memory manager.ns_getservicemanagerthe ns_getservicemanager function returns a reference to the xpcom service manager.ns_initxpcom2the ns_initxpcom2 func...
nsCOMPtr
« xpcom api reference summary this utility class simplifies managing xpcom interface references from c++ code. #include "nscomptr.h" remarks consult using nscomptr for more info. to use this class, you must link your component or application against the xpcom glue library. the class itself and the supporting functions that are used with it are not frozen, but they are available as part of the xpcom glue library for easy reuse. ...
nsMemory
ze function attempts to shrink the size of the heap. clone the clone function creates a copy of an existing memory block up to the size specified. getglobalmemoryservice the getglobalmemoryservice function returns a reference to xpcom's global nsimemory object. remarks to use the methods in this class, you must link your component or application against the xpcom glue library. the static methods defined on this class are not frozen. however, if you use these functions in your xpcom component, and if you link to the xpcom glue library, then your component will only have a runtime dependency on the frozen xpcom api. see also nsimemory ...
nsSupportsWeakReference
k reference for detailed description of weak references. #include "nsweakreference.h" class nssupportsweakreference { ... }; remarks in addition to inheriting from this class, you will need to ensure that your nsisupports::queryinterface implementation exposes nsisupportsweakreference as a supported interface. to use this class, you must link your component or application against the xpcom glue library. example code // supporting weak references to a hypothetical implementation // of the nsifoo interface... #include "nsweakreference.h" #include "nsifoo.h" class myfoo : public nsifoo, public nssupportsweakreference { public: ns_decl_isupports ns_decl_nsifoo ... }; ns_impl_isupports2(myfoo, nsifoo, nsisupportsweakreference) ... see also nsisupports::queryinterface , nsisu...
XPCOM glue classes
these "glue" classes are provided to make it easier to use xpcom from c++ code. when these classes are used by a component, you may need to link the component against the xpcom glue library. ns convertasciitoutf16 externalclass declarationns convertutf16toutf8 externalclass declarationns convertutf8toutf16 externalclass declarationns lossyconvertutf16toascii externalclass declarationns_convertasciitoutf16class declarationns_convertutf16toutf8class declarationns_convertutf8toutf16class declarationns_lossyconvertutf16toasciiclass declarationns_overridens_override is a macro which allows c++ code in mozilla to specify that a method is intended to override a base class method. if there is no base class method with the same signature, a compiler with static-checking enabled will fail to c...
mozIStorageConnection
database nsifile. null if the database connection refers to an in-memory database. read only. lasterror long the last sqlite error code that occurred. read only. note: this is not reliable if you are using asynchronous statements or if you are using the connection on multiple threads. lasterrorstring autf8string the english error string reported by the sqlite library for the last sqlite operation. read only. note: this is not reliable if you are using asynchronous statements or if you are using the connection on multiple threads. lastinsertrowid long long the row id from the last sql insert operation. read only. note: this is not reliable if you are using asynchronous statements or if you are using the connection on multiple threads. ...
mozIStorageError
schema 17 the database schema changed. toobig 18 a string or blob exceeds the size limit. constraint 19 aborted due to a constraint violation. internal 2 an internal logic error occurred. mismatch 20 a data type mismatch occurred. misuse 21 library used incorrectly. nolfs 22 attempted to use os features not supported on the host system. auth 23 authorization denied. format 24 auxiliary database format error. notadb 26 the opened file is not a database. perm 3 access permission denied. ab...
nsIAppShell
to suspendnative and resumenative() may be nested. on some platforms (those that do not use any "additional methods") this will be a no-op. does not (in itself) stop gecko events from being processed on the main application thread. but if the nsiappshell->run() event loop is blocked when this call is made, gecko events will stop being processed until resumenative() is called (even if a plugin or library is temporarily processing events on a nested event loop). void suspendnative(); parameters none. ...
nsIComponentRegistrar
hods autoregister() register a component (.manifest) file or all component files in a directory. registration lasts for this run only, and is not cached. note: formerly this method would register component files directly. this is no longer supported. component files must have an associated loader and export the required symbols which this loader defines. for example, if the given file is a native library, it must export the symbol nsgetmodule. other loaders may have different semantics. this method may only be called from the main thread. void autoregister( in nsifile aspec ); parameters aspec this parameter indicates either a component file to be registered or a directory containing component files to be registered. xpcom <= 1.8: if aspec is null, then the application component's directory ...
getFile
os_current_process_dir "curprocd" ns_xpcom_current_process_dir "xcurprocd" can be overriden by passing a "bin directory" to ns_initxpcom2(). ns_xpcom_component_dir "comsd" ns_xpcom_component_dir_list "comsdl" ns_xpcom_component_registry_file "comregf" ns_xpcom_xpti_registry_file "xptiregf" ns_xpcom_library_file "xpcomlib" ns_gre_dir "gred" note: on mac os x, up through firefox 34 this is the contents/macos directory within the application's bundle. starting with firefox 35, this is contents/resources. this change was required in order to comply with apple's new gatekeeper v2 rules; without this change, firefox would not work on any mac os x newer than 10.9.4. ...
nsIFile
void normalize(); file openansifiledesc(in string mode); prfiledescstar opennsprfiledesc(in long flags, in long mode); void renameto(in nsifile newparentdir, in astring newname); void...
nsIPrefService
the preference service is directly responsible for the management of the preferences files and also facilitates access to the preference branch object which allows the direct manipulation of the preferences themselves. ...
nsISupportsWeakReference
duced for objects that implement this interface. inherits from: nsisupports last changed in gecko 1.7 method overview nsiweakreference getweakreference(); methods getweakreference() produces an appropriate instance of nsiweakreference. nsiweakreference getweakreference(); parameters none. return value the resulting nsiweakreference instance. remarks the xpcom glue library provides nssupportsweakreference, a canonical implementation of nsisupportsweakreference. this interface was frozen for gecko 0.9.9. see bug 48726 for details. from gecko 2.0 interfaces are no longer frozen. see also nsiweakreference nssupportsweakreference ...
Reference Manual
inery although it is a class, nscomptr has no virtual methods, and therefore, no vtable or vptr. because a few key routines are factored out into a common non-template base class, the actual underlying pointer is stored as an nsisupports* (except in debug builds where nscap_feature_debug_ptr_types is turned on). it is because of these factored routines that nscomptr users must link with the xpcom library. when nscap_feature_debug_ptr_types is turned on, instead of holding its underlying pointer in a variable of type nsisupports*, the nscomptr holds it in a pointer matching the underlying type. this allows source level debuggers to more easily "follow" the pointer. however, the routines that would normally be factored into a base class now must become template-specific inlines. there is no factore...
Status, Recent Changes, and Plans
ptr<nsisupports>, so that it is now a pointer to any xpcom interface. added do_queryreferent to make using nsiweakreferences easier. plans for nscomptr bug 59212: as soon as we test on more compilers, start recommending already_addrefed as a function result. bug 59414: making operator& private may help prevent some leaks caused by casting move the factored nscomptr routines into their own library, to reduce nscomptr clients' dependency on the xpcom library. recent changes to this document removed the statement that == and != between an nscomptr and a raw pointer or literal 0 does not work on some compilers since it is no longer true. added an entire section to the getting started guide on nscomptrs in function signatures added references to recent bugs influencing the use of nscomp...
xptcall FAQ
it is implemented using platform specific c/c++ and assembly language code. it is used to facilitate cross language and cross thread method calls. porting this code is required in order to make mozilla run on any given platform. why does xptcall exist? xptcall exists for two reasons: to support invoking arbitrary methods on xpcom interfaces. to support dynamically impersonating any xpcom interface. both of these facilities are required by xpconnect. these facilities are also used by xpcom/proxy. it may also be used by other subsystems in the future. ...
Xptcall Porting Guide
it does this using platform specific assembly language code. this code needs to be ported to all platforms that want to support xptcall (and thus mozilla). ...
Mail client architecture overview
rder to perform network operations such as downloading new mail, copying and moving messages, and displaying messages from a remote server, the url system interacts with necko and reflects it's state to the mail window. there are also a number of protocol independant subsystems that have a symbiotic relationship with base: libmime - for dealing with rfc822 messages and their mime parts. this library has the cabability to stream messages to an html renderer such as gecko, manage individual parts of messages, and so forth. msgdb - a message database for a given folder is a summary of some of the key attributes in a folder such as the author and subject. finally, there are larger modules outside of the mail client that are mail-oriented. most of these modules have little dependancy on the ma...
Thunderbird Configuration Files
settings\[user name]\application data\thunderbird\profiles\ on windows xp/2000 or c:\users\[user name]\appdata\roaming\thunderbird\profiles\ on windows vista, and the rest should be obvious. on windows 95/98/me, the path is usually c:\windows\application data\thunderbird\profiles\xxxxxxxx.default\ on linux, the path is usually ~/.thunderbird/xxxxxxxx.default/ on mac os x, the path is usually ~/library/thunderbird/profiles/xxxxxxxx.default/ %appdata% is a shorthand for the application data path on windows 2000/xp/vista. to use it, click start > run... (use the search box on vista), enter %appdata% and press enter. you will be taken to the "real" folder, which is normally c:\documents and settings\[user name]\application data on windows xp/2000, c:\users\[user name]\appdata\roaming on windows ...
Demo Addon
mo overview. all three demos are explained in the following sections. only the interesting parts are shown, it's recommended that you download the add-on and have a look at its files. the basics the interesting parts covered in this article are in the content folder. the toolbar button and its functionality are defined in overlay.xul and overlay.js. we make use of fixiterator(). it is a handy library that keeps your code cleaner and simpler. it lets you iterate over any collection and transforms your collection elements in the given objects, to use fixiterator, you have to import it with cu.import("resource:///modules/iteratorutils.jsm");. demo 1 - iterate over all the accounts this demo is implemented in demo1.html in the content folder. it lists all your email accounts with their account ...
Thunderbird extensions
more thunderbird-specific links some links may be out of date, but they still provide valuable information on the codebase. ...
Using JS in Mozilla code
js language features that are implemented in the mozilla js engine are ordinarily safe to use in mozilla code. however, there are a few exceptions, listed here. js language features proper tail calls are not implemented. js standard library features feature standard can be used in code new proxy(target, handler) es2015 yes, but getprototypeof and setprototypeof handlers are not yet implemented. arraybuffer.transfer() proposed for es2016 no, nightly-only for now sharedarraybuffer, sharedint8array..., atomics proposed for es2016 no, nightly-only for now typedobject proposed for es2016 no, nightly-only for now simd proposed for es2016 no, nightly-only for now ...
Using Mozilla code in other projects
how to code-sign applications based on mozilla code for mac os x's application security model. using mozilla components spidermonkey spidermonkey is the javascript runtime engine used by mozilla projects. nspr the netscape portable runtime provides a platform-neutral api for system level and libc-type functions. necko the mozilla networking library provides cross-platform networking functionality. embedding mozilla for information on embedding a web browser into your own application see embedding mozilla. ...
Using the Mozilla symbol server
d files = 4 symchk: passed + ignored files = 179 downloading symbols on linux / mac os x if you are on linux and running gdb 7.9 or newer, you can use this gdb python script to automatically fetch symbols. you will need to source this script before loading symbols (the part where it spends a few seconds loading each .so when you attach gdb). if you want to reload symbols, you can try: nosharedlibrary sharedlibrary lib on older gdb and mac os x there is a python script to download symbols from the mozilla symbol server for gdb, shark and other software that uses symbols. note that the symbol file for the xul library is very large and takes some time to download. this may make it appear as if the script has gotten stuck, but it will continue. symbol indices are named like so: symbols.mozilla.
Working with windows in chrome code
om inside a window. the functionality isn't lost, however -- you just have to use the xpcom components directly instead of using convenient shortcuts. of course, this doesn't matter if you just store data in the component. learning to create xpcom components takes time. there are several articles and books about creating xpcom components online. using fuel application object the fuel library has been deprecated as of firefox 41 the fuel javascript library has a simple method for sharing data between windows. the application object supports a storage property which can be used to store data globally. this method is a simplified form of the xpcom singleton method. application.storage.set(keyname, data); var data = application.storage.get(keyname, default); where: keyname is a str...
Using COM from js-ctypes
ypes.voidptr_t }, { 'getvolume': ctypes.voidptr_t }, { 'waituntildone': ctypes.voidptr_t }, { 'setsyncspeaktimeout': ctypes.voidptr_t }, { 'getsyncspeaktimeout': ctypes.voidptr_t }, { 'speakcompleteevent': ctypes.voidptr_t }, { 'isuisupported': ctypes.voidptr_t }, { 'displayui': ctypes.voidptr_t } // end ispvoice ]); // functions // http://msdn.microsoft.com/en-us/library/windows/desktop/ms695279%28v=vs.85%29.aspx let coinitializeex = lib.declare('coinitializeex', winabi, hresult, // result lpvoid, // pvreserved dword // dwcoinit ); // http://msdn.microsoft.com/en-us/library/windows/desktop/ms688715%28v=vs.85%29.aspx let couninitialize = lib.declare('couninitialize', winabi, void // return ); // http://msdn.microsoft.com/en-us/lib...
Declaring and Calling Functions
once declared, functions can be called using standard function syntax. prerequiste understanding see abi. example: no input parameters in this example, we declare the libc clock() function, which returns the elapsed time since system startup, then fetch and output that value. const clock = lib.declare("clock", ctypes.default_abi, ctypes.unsigned_long); console.log("clocks since startup: " + clock()); the clock() function requires no input parameters; it simply returns an unsigned long. example: multiple input parameters this example declares the libc asctime() function, which converts a time structure into a string. ...
Memory Management
e correct allocator. it is usually best to expose a freeing function from the binary. keeping objects alive the following js-ctypes objects will hold references to objects, keeping them alive. this is not an exhaustive list, but will help you to understand memory management and how it affects your use of js-ctypes: a function or static data declared using the declare() method will hold that library alive. a ctype will hold referent ctype objects alive. a cdata will hold referent cdata objects alive, under specific circumstances. for example, a cdata object produced by accessing a field of a structure or the internals of an array will hold the referent objects alive. what won't keep objects alive it's important to note that getting direct access to the contents of a cdata object using a...
Type conversion
implicit convert in js-ctypes, data could be converted implicitly when passing to or returning from a functiontype call, or setting pointer content, an array element or a struct field. ...
Working with ArrayBuffers
ctypes.winapi_abi : ctypes.default_abi, ctypes.void_t, // return ctypes.void_t.
ctypes.open
function. this must be called before any work can commence. there are two options: custom native file (dll, so, dylib, etc.) standard os libraries custom native file for this method, a native file must be created. a native file for use on unix systems is an so file, which is created and a c function called add() is written. int add(int a, int b) { return a + b; } to make this a shared library, a native file which can be loaded and used from js-ctypes, compile it with these commands: gcc -fpic -c mycfuntionsforunix.c gcc -shared -o mycfuntionsforunix.so mycfuntionsforunix.o a file named mycfuntionsforunix.so is successfully created. this native file can be placed in any folder of an addon and then loaded from js-ctypes. they can also be loaded from the system library path. loading ...
FunctionType
ot be constructed. ...
Ignore a source - Firefox Developer Tools
however, you can tell the debugger to ignore the details of selected sources. ...
Index - Firefox Developer Tools
, devtools, page inspector if you hover over a dom node in the watch expresions, it will be highlighted in the page. 124 ignore a source in modern web development, we often rely on libraries like jquery, ember, or angular, and 99% of the time we can safely assume that they “just work”. we don’t care about the internal implementation of these libraries. however, a library’s abstraction leaks during debugging sessions when you are forced to step through its stack frames in order to reach your own code. however, you can tell the debugger to ignore the details of selected sources. 125 open the debugger there are three ways to open the debugger: 126 pretty-print a minified file javascript to prettify a minified file, click ...
ANGLE_instanced_arrays - Web APIs
ensions in the webgl tutorial. availability: this extension is only available to webgl1 contexts. in webgl2, the functionality of this extension is available on the webgl2 context by default and the constants and methods are available without the "angle" suffix. despite the name "angle", this extension works on any device if the hardware supports it and not just on windows when using the angle library. "angle" just indicates that this extension has been written by the angle library authors. constants this extension exposes one new constant, which can be used in the gl.getvertexattrib() method: ext.vertex_attrib_array_divisor_angle returns a glint describing the frequency divisor used for instanced rendering when used in the gl.getvertexattrib() as the pname parameter. methods this ex...
Element: webkitmouseforcechanged event - Web APIs
...
Element: webkitmouseforcedown event - Web APIs
...
Element: webkitmouseforceup event - Web APIs
...
Element: webkitmouseforcewillbegin event - Web APIs
...
EventTarget.addEventListener() - Web APIs
? { passive: true } : false); here we're adding a listener for the mouseup event on the element someelement. for the third parameter, if passivesupported is true, we're specifying an options object with passive set to true; otherwise, we know that we need to pass a boolean, and we pass false as the value of the usecapture parameter. if you'd prefer, you can use a third-party library like modernizr or detect it to do this test for you. you can learn more from the article about eventlisteneroptions from the web incubator community group. examples add a simple listener this example demonstrates how to use addeventlistener() to watch for mouse clicks on an element. html <table id="outside"> <tr><td id="t1">one</td></tr> <tr><td id="t2">two</td></tr> </table> javascri...
Force Touch events - Web APIs
...
Fullscreen API - Web APIs
tions from the screen until full-screen mode is shut off. see the article guide to the fullscreen api for details on how to use the api. note: support for this api varies somewhat across browsers, with many requiring vendor prefixes and/or not implementing the latest specification. see the browser compatibility section below for details on support for this api. you may wish to consider using a library such as fscreen for vendor agnostic access to the fullscreen api. interfaces the fullscreen api has no interfaces of its own. instead, it augments several other interfaces to add the methods, properties, and event handlers needed to provide full-screen functionality. these are listed in the following sections. methods the fullscreen api adds methods to the document and element interfaces to ...
GestureEvent - Web APIs
ue: 1.0 methods this interface also inherits methods of its parents, uievent and event. gestureevent.initgestureevent() initializes the value of an gestureevent. if the event has already being dispatched, this method does nothing. gesture event types gesturestart gesturechange gestureend specifications not part of any specification. apple has a description at the safari developer library. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgestureevent non...
HTMLImageElement.complete - Web APIs
/compositing. the image element has previously determined that the image is fully available and ready for use. the image is "broken;" that is, the image failed to load due to an error or because image loading is disabled. it's worth noting that due to the image potentially being received asynchronously, the value of complete may change while your script is running. examples consider a photo library app that provides the ability to open images into a lightbox mode for improved viewing as well as editing of the image. these photos may be very large, so you don't want to wait for them to load, so your code uses async/await to load the images in the background. but imagine that you have other code that needs to only run when the image has completed loading, such as a command that performs red-...
In depth: Microtasks and the JavaScript runtime environment - Web APIs
y complex or lengthy operations, leaving the main thread to do as little work as possible beyond updating, laying out, and rendering the web page. this is further alleviated by using asynchronous javascript techniques such as promises to allow the main code to continue to run while waiting for the results of a request. however, code running at a more fundamental level—such as code comprising a library or framework—may need a way to schedule code to be run at a safe time while still executing on the main thread, independent of the results of any single request or task. microtasks are another solution to this problem, providing a finer degree of access by making it possible to schedule code to run before the next iteration of the event loop begins, instead of having to wait until the next one...
IDBOpenDBRequest.onupgradeneeded - Web APIs
idbopendbrequest.onupgradeneeded = function(event) { ... }; example in the following example you can see the onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded. for a full working example, see our to-do notifications app (view example live.) var db; // request version 3 of the database. var request = window.indexeddb.open("library", 3); // this event handles the event whereby a new version of the // database needs to be created. either one has not been created // before, or a new version number has been submitted via the // window.indexeddb.open line above. request.onupgradeneeded = function(event) { db = request.result; db.onerror = function(errorevent) { note.innerhtml += '<li>error loading database.</li>'; }...
Basic concepts - Web APIs
indexeddb is a way for you to persistently store data inside a user's browser. because it lets you create web applications with rich query abilities regardless of network availability, these applications can work both online and offline. indexeddb is useful for applications that store a large amount of data (for example, a catalog of dvds in a lending library) and applications that don't need persistent internet connectivity to work (for example, mail clients, to-do lists, and notepads). about this document this introduction discusses essential concepts and terminology in indexeddb. it gives you the big picture and explains key concepts. you'll find the following useful: for an overview of the design and structure of indexeddb, see big concepts. to learn more about indexeddb terms, see ...
IndexedDB API - Web APIs
abase operations. idbtransactionsync sync version of idbtransaction. idbobjectstoresync sync version of idbobjectstore. idbindexsync sync version of idbindex. idbfactorysync sync version of idbfactory. idbenvironmentsync sync version of idbenvironment. idbdatabasesync sync version of idbdatabase. idbcursorsync sync version of idbcursor. examples elibri: a powerful library and ebook reader application, written by marco castelluccio, winner of the indexeddb mozilla devderby. to-do notifications (view example live): the reference application for the examples in the reference docs. storing images and files in indexeddb specifications specification status comment indexed database api draft recommendation indexed database...
Intersection Observer API - Web APIs
e past involved event handlers and loops calling methods like element.getboundingclientrect() to build up the needed information for every element affected. since all this code runs on the main thread, even one of these can cause performance problems. when a site is loaded with these tests, things can get downright ugly. consider a web page that uses infinite scrolling. it uses a vendor-provided library to manage the advertisements placed periodically throughout the page, has animated graphics here and there, and uses a custom library that draws notification boxes and the like. each of these has its own intersection detection routines, all running on the main thread. the author of the web site may not even realize this is happening, since they may know very little about the inner workings of the...
MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN - Web APIs
...
MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN - Web APIs
...
MouseEvent.webkitForce - Web APIs
...
WebGLRenderingContext.getActiveAttrib() - Web APIs
syntax webglactiveinfo gl.getactiveattrib(program,index); parameters program a webglprogram containing the vertex attribute. index a gluint specifying the index of the vertex attribute to get. ...
WebGLRenderingContext.getActiveUniform() - Web APIs
syntax webglactiveinfo webglrenderingcontext.getactiveuniform(program, index); parameters program a webglprogram specifying the webgl shader program from which to obtain the uniform variable's information. index a gluint specifying the index of the uniform attribute to get. ...
Matrix math for the web - Web APIs
rixresult = multiplymatrices(identitymatrix, somematrix); important: these matrix functions are written for clarity of explanation, not for speed or memory management. these functions create a lot of new arrays, which can be particularly expensive for real-time operations due to garbage collection. in real production code it would be best to use optimized functions. glmatrix is an example of a library that has a focus on speed and performance. the focus in the glmatrix library is to have target arrays that are allocated before the update loop. translation matrix a translation matrix is based upon the identity matrix, and is used in 3d graphics to move a point or object in one or more of the three directions (x, y, and/or z). the easiest way to think of a translation is like picking up a cof...
Animating objects with WebGL - Web APIs
you'll need to include it if you create your own project based on this code. our sample loads a copy from a cdn in our html's <head>. making the square rotate let's start by making the square rotate. the first thing we'll need is a variable in which to track the current rotation of the square: var squarerotation = 0.0; now we need to update the drawscene() function to apply the current rotation to the square when drawing it. ...
Animating textures in WebGL - Web APIs
« previous in this demonstration, we build upon the previous example by replacing our static textures with the frames of an mp4 video file that's playing. this is actually pretty easy to do and fun to watch, so let's get started. you can use similar code to use any sort of data (such as a <canvas>) as the source for your textures. this example uses the glmatrix library to perform its matrix and vertex math. you'll need to include it if you create your own project based on this code. our sample loads a copy from a cdn in our html's <head>. getting access to the video the first step is to create the <video> element that we'll use to retrieve the video frames: // will set to true when video can be copied to texture var copyvideo = false; function setupvideo(url) { const video = doc...
Creating 3D objects using WebGL - Web APIs
x by its index into that array instead of moving entire sets of coordinates around. if you wonder why we need 24 vertices, and not just 8, it is because each corner belongs to three faces of different colors, and a single vertex needs to have a single specific color; therefore we will create three copies of each vertex in three different colors, one for each face. this example uses the glmatrix library to perform its matrix and vertex math. you'll need to include it if you create your own project based on this code. our sample loads a copy from a cdn in our html's <head>. define the positions of the cube's vertices first, let's build the cube's vertex position buffer by updating the code in initbuffers(). this is pretty much the same as it was for the square plane, but somewhat longer since ...
Lighting in WebGL - Web APIs
w, webgl doesn't have much built-in knowledge. it just runs two functions you supply — a vertex shader and a fragment shader — and expects you to write creative functions to get the results you want. in other words, if you want lighting you have to calculate it yourself. fortunately, it's not all that hard to do, and this article will cover some of the basics. this example uses the glmatrix library to perform its matrix and vertex math. you'll need to include it if you create your own project based on this code. our sample loads a copy from a cdn in our html's <head>. simulating lighting and shading in 3d although going into detail about the theory behind simulated lighting in 3d graphics is far beyond the scope of this article, it's helpful to know a bit about how it works. instead of d...
Using shaders to apply color in WebGL - Web APIs
you'll need to include it if you create your own project based on this code. our sample loads a copy from a cdn in our html's <head>. applying color to the vertices in webgl objects are built using sets of vertices, each of which has a position and a color. ...
Using textures in WebGL - Web APIs
you'll need to include it if you create your own project based on this code. our sample loads a copy from a cdn in our html's <head>. loading textures the first thing to do is add code to load the textures. in our case, we'll be using a single texture, mapped onto all six sides of our rotating cube, but the same technique can be used for any number of textures. ...
Using WebGL extensions - Web APIs
nsions behind a feature flag rather than vendor prefix. the feature flags are: webgl.enable-draft-extensions in firefox chrome://flags/#enable-webgl-draft-extensions in chromium based browsers (chrome, opera). naming conventions webgl extensions are prefixed with "angle", "oes", "ext" or "webgl". these prefixes reflect origin and intent: angle_: extensions that are written by the angle library authors. oes_ and khr_: extensions that mirror functionality from opengl es (oes) or opengl api extensions approved by the respective architecture review boards (khronos). ovr_: extensions that optimize for virtual reality. ext_: extensions that mirror other opengl es or opengl api extensions. webgl_: extensions that are webgl-specific and intended to be compatible with multiple web browsers.
WebGL best practices - Web APIs
d_texture_s3tc (desktop) webgl_compressed_texture_etc1 (android) webgl_compressed_texture_pvrtc (ios) webgl 2 has universal support by combining: webgl_compressed_texture_s3tc (desktop) webgl_compressed_texture_etc (mobile) webgl_compressed_texture_astc has both higher quality and/or higher compression, but is only supported on newer hardware. basis universal texture compression format/library basis universal solves several of the issues mentioned above. it offers a way to support all common compressed texture formats with a single compressed texture file, through a javascript library that efficiently converts formats at load time. it also adds additional compression that makes basis universal compressed texture files much smaller than regular compressed textures over-the-wire, more c...
Using WebRTC data channels - Web APIs
n which your code is running—the webrtc implementation implements features to support messages that are larger than the maximum packet size on the network's transport layer. this can complicate things, since you don't necessarily know what the size limits are for various user agents, and how they respond when a larger message is sent or received. even when user agents share the same underlying library for handling stream control transmission protocol (sctp) data, there can still be variations due to how the library is used. for example, both firefox and google chrome use the usrsctp library to implement sctp, but there are still situations in which data transfer on an rtcdatachannel can fail due to differences in how they call the library and react to errors it returns. when two users running...
WebRTC API - Web APIs
together to achieve this. the documentation you'll find here will help you understand the fundamentals of webrtc, how to set up and use both data and media connections, and more. interoperability because implementations of webrtc are still evolving, and because each browser has different levels of support for codecs and webrtc features, you should strongly consider making use of the adapter.js library provided by google before you begin to write your code. adapter.js uses shims and polyfills to smooth over the differences among the webrtc implementations across the environments supporting it. adapter.js also handles prefixes and other naming differences to make the entire webrtc development process easier, with more broadly compatible results. the library is also available as an npm package. ...
Fundamentals of WebXR - Web APIs
st cases. instead, you'll probably do most of your work making use of one of the frameworks or libraries that are built atop webgl to make it more convenient to use. a particular benefit to using a framework rather than directly using the webgl api is that libraries tend to implement virtual camera functionality. opengl (and thus webgl by extension) does not directly offer a camera view, using a library that simulates one on your behalf can make your job much, much easier, especially when building code that allows free movement through your virtual world. since webgl is used for rendering the 3d world into the webxr session, you should first be familiar with webgl's general usage, and with the basics of 3d graphics in general. general-purpose 3d frameworks these frameworks are good for genera...
Web Animations API Concepts - Web APIs
amic animations that can be updated on the fly as well as more straightforward, declarative animations like those css creates. it can be used in automated tests to ensure that your ui animations are running correctly. it opens up the browser’s rendering engine for building animation development tools like timelines. it is also a performant base on which to build a custom or commercial animation library. (see animating like you just don’t care with element.animate.) in some instances, it may negate the need for a fully fledged library entirely in the same way vanilla javascript can be used without jquery for many purposes. polyfill the web animation api has a polyfill that you can use today. ...
Advanced techniques: Creating and sequencing audio - Web APIs
ell as timing and scheduling. we're going to introduce sample loading, envelopes, filters, wavetables, and frequency modulation. if you're familiar with these terms and you're looking for an introduction to their application within with the web audio api, you've come to the right place. demo we're going to be looking at a very simple step sequencer: in practice this is easier to do with a library — the web audio api was built to be built upon. if you are about to embark on building something more complex, tone.js would be a good place to start. however, we want to demonstrate how to build such a demo from first principles, as a learning exercise. note: you can find the source code on github as step-sequencer; see the step-sequencer running live also. the interface consists of master...
Web Audio API best practices - Web APIs
a few depending on your use case. for a good all-rounder, howler.js is a good choice. it has cross-browser support and, provides a useful subset of functionality. although it doesn't harness the full gamut of filters and other effects the web audio api comes with, you can do most of what you'd want to do. if you are looking for sound creation or a more instrument-based option, tone.js is a great library. it provides advanced scheduling capabilities, synths, and effects, and intuitive musical abstractions built on top of the web audio api. r-audio, from the bbc's research & development department, is a library of react components aiming to provide a "more intuitive, declarative interface to web audio". if you're used to writing jsx it might be worth looking at. autoplay policy browsers have st...
Migrating from webkitAudioContext - Web APIs
udiocontext or old naming conventions in the web audio specification may not immediately work out of the box in a compliant web audio implementation. this article attempts to summarize the areas where developers are likely to encounter these problems and provide examples on how to port such code to standards based audiocontext, which will work across different browser engines. note: there is a library called webkitaudiocontext monkeypatch, which automatically fixes some of these changes to make most code targetting webkitaudiocontext to work on the standards based audiocontext out of the box, but it currently doesn't handle all of the cases below. please consult the readme file for that library to see a list of apis that are automatically handled by it. changes to the creator methods three...
Web audio spatialization basics - Web APIs
rowsers. the panner node does some very involved maths under the hood; there are a number of tests here so you can keep track of the status of the inner workings of this node across different platforms. again, you can check out the final demo here, and the final source code is here. there is also a codepen demo too. if you are working with 3d games and/or webxr it's a good idea to harness a 3d library to create such functionality, rather than trying to do this all yourself from first principles. we rolled our own in this article to give you an idea of how it works, but you'll save a lot of time by taking advantage of work others have done before you. ...
Web Audio API - Web APIs
icle basic concepts behind web audio api. web audio api target audience the web audio api can seem intimidating to those that aren't familiar with audio or music terms, and as it incorporates a great deal of functionality it can prove difficult to get started if you are a developer. it can be used to simply incorporate audio into your website or application, by providing atmosphere like futurelibrary.no, or auditory feedback on forms. however, it can also be used to create advanced interactive instruments. with that in mind, it is suitable for both developers and musicians alike. we have a simple introductory tutorial for those that are familiar with programming but need a good introduction to some of the terms and structure of the api. there's also a basic concepts behind web audio api art...
Functions and classes available to Web Workers - Web APIs
url workers can use the static methods url.createobjecturl and url.revokeobjecturl with blob objects accesible to the worker. workers can also create a new url using the url() constructor and call any normal method on the returned object. 21 (21) and 26 (26) for url() constructor no support no support no support webgl with offscreencanvas webgl (web graphics library) is a javascript api for rendering interactive 3d and 2d graphics within any compatible web browser without the use of plug-ins. 44 (44) behind a feature preference setting. in about:config, set gfx.offscreencanvas.enabled to true. no support no support no support websocket creates and returns a new websocket object; this mimics the behavior of the standard websocket() co...
Sending and Receiving Binary Data - Web APIs
. the response property will contain the entity body according to responsetype, as an arraybuffer, blob, document, json, or string. this is null if the request is not complete or was not successful. this example reads an image as a binary file and creates an 8-bit unsigned integer array from the raw bytes. note that this will not decode the image and read the pixels. you will need a png decoding library for that. var oreq = new xmlhttprequest(); oreq.open("get", "/myfile.png", true); oreq.responsetype = "arraybuffer"; oreq.onload = function (oevent) { var arraybuffer = oreq.response; // note: not oreq.responsetext if (arraybuffer) { var bytearray = new uint8array(arraybuffer); for (var i = 0; i < bytearray.bytelength; i++) { // do something with each byte in the array } ...
XRRigidTransform.matrix - Web APIs
+ q_zq_w) & 1 - 2(q_x^2 + q_z^2) & 2(q_yq_z - q_xq_w) & p_y\\ 2(q_xq_z - q_yq_w) & 2(q_yq_z + q_xq_w) & 1 - 2(q_x^2 + q_y^2) & p_z\\ 0 & 0 & 0 & 1 \end{bmatrix} examples in this example, a transform is created to create a matrix which can be used as a transform during rendering of webgl objects, in order to place objects to match a given offset and orientation. the matrix is then passed into a library function that uses webgl to render an object matching a given name using the transform matrix specified to position and orient it. let transform = new xrrigidtransform( {x: 0, y: 0.5, z: 0.5}, {x: 0, y: -0.5, z: -0.5, w: 1}); drawglobject("magic-lamp", transform.matrix); specifications specification status comment webxr d...
Using the alert role - Accessibility
ment with an alert role and adds it to the document structure. let myalert = document.createelement("p"); myalert.setattribute("role", "alert"); let myalerttext = document.createtextnode("you must agree with our terms of service to create an account."); myalert.appendchild(myalerttext); document.body.appendchild(myalert); note: the same result can be achieved with less code when using a script library like jquery: $("<p role='alert'>you must agree with our terms of service to create an account.</p>").appendto(document.body); example 3: adding alert role to an existing element sometimes it's useful to add an alert role to an element that is already visible on the page rather than creating a new element. this allows the developer to reiterate information that has become more relevant or urge...
Web applications and ARIA FAQ - Accessibility
or buggy aria implementations. for notes on jaws support for aria as of jaws 10, see this article from the paciello group: jaws support for aria. javascript toolkits aria roles, states, and properties have been added to a number of popular javascript user interface toolkits, including: dojo/dijit jquery ui fluid infusion google closure google web toolkit bbc glow yahoo! user interface library (yui) for more information about javascript toolkit accessibility: steve faulkner's wai-aria implementation in javascript ui libraries can you show me an example of aria in action? sure. here's the markup for a progress bar widget: <div id="percent-loaded" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" /> this progress bar is built using a <div>, which is no...
An overview of accessible web applications and widgets - Accessibility
sliders, menu bars, file list views, and more can be built with a combination of javascript, css, and html. since the html4 specification doesn't provide built-in tags that semantically describe these kinds of widgets, developers typically resort to using generic elements such as <div> and <span>. while this results in a widget that looks like its desktop counterpart, there usually isn't enough semantic information in the markup to be usable by an assistive technology. the problem dynamic content on a web page can be particularly problematic for users who, for whatever reason, are unable to view the screen. ...
Accessibility documentation index - Accessibility
n help prevent exposure to content leading to seizures and / or other physical reactions. 86 accessible dynamic content accessibility this content has been moved to an overview of accessible web applications and widgets. 87 an overview of accessible web applications and widgets aria, accessibility, guide, web apps, widget most javascript libraries offer a library of client-side widgets that mimic the behavior of familiar desktop interfaces. sliders, menu bars, file list views, and more can be built with a combination of javascript, css, and html. since the html4 specification doesn't provide built-in tags that semantically describe these kinds of widgets, developers typically resort to using generic elements such as and . while this results in a widget t...
Text labels and names - Accessibility
what resources the areas links to. failure to do so makes an image map hard to use for users of assistive technology — they need alternative text to be able to understand the purpose of an image. examples the following example show a simple image map (taken from h24: providing text alternatives for the area elements of image maps): <img src="welcome.gif" usemap="#map1" alt="areas in the library. select an area for more information on that area." /> <map id="map1" name="map1"> <area shape="rect" coords="0,0,30,30" href="reference.html" alt="reference" /> <area shape="rect" coords="34,34,100,100" href="media.html" alt="audio visual lab" /> </map> see the <area> element reference page for a live interactive example. see also <area> h24: providing text alternatives for the...
Cross-browser Flexbox mixins - CSS: Cascading Style Sheets
instead, you will need to use a css pre-processor to make the most of the following. however, css pre-processors simply generate valid css, so the techniques used below can be ...
Typical use cases of Flexbox - CSS: Cascading Style Sheets
ges. you could add a label or icon to the left as easily as we popped the button onto the right. i have added a label, and other than some styling for background colour i didn’t need to change the layout. the stretchy input field now has a little less space to play with but it uses the space left after the two items are accounted for. patterns like this can make it much easier to create a library of form elements for your design, which easily accommodate additional elements being added. you are taking advantage of the flexibility of flexbox by mixing items that do not grow with those that do. conclusion while exploring the above patterns you have hopefully started to see how you can think through the best way to use flexbox to achieve the result that you want. quite often you have more ...
Audio and Video Delivery - Developer guides
t for subtitles can also be provided through media libraries. audio only soundmanager amplitudejs howlerjs video only flowplayer: gratis with a flowplayer logo watermark. open source (gpl licensed.) jwplayer: requires registration to download. open source edition (creative commons license.) sublimevideo: requires registration. form based set up with domain specific link to cdn hosted library. video.js: gratis and open source (apache 2 licensed.) audio and video jplayer: gratis and open source (mit licensed.) mediaelement.js: gratis and open source (mit licensed.) web audio api audiocontext monkeypatch: a polyfill for older versions of the web audio api; open source (apache 2 licensed.) basic tutorials creating a cross-browser video player a guide to creating a basic...
Constraint validation - Developer guides
de format varies from one country to another. not only do most countries allow an optional prefix with the country code (like d- in germany, f- in france or switzerland), but some countries have postal codes with only a fixed number of digits; others, like the uk, have more complex structures, allowing letters at some specific positions. note: this is not a comprehensive postal code validation library, but rather a demonstration of the key concepts. as an example, we will add a script checking the constraint validation for this simple form: <form> <label for="zip">zip : </label> <input type="text" id="zip"> <label for="country">country : </label> <select id="country"> <option value="ch">switzerland</option> <option value="fr">france</option> <option value="...
A hybrid approach - Developer guides
me of the performance problems with responsive design by incorporating server-side techniques. for example, an often-criticized point about responsive web design is that full-resolution images are sent to all devices, including phones that show the images scaled down anyway. one such technique for dealing with this issue uses server-side user-agent detection along with the wurfl device capability library to send a properly sized image for the user’s device. a range of products are also emerging which provide this as a service. of course, this technique suffers from all the downsides associated with user-agent detection. but even if it does not work, it is no worse with respect to performance than only using fluid images. by combining the techniques listed above, we can get a mobile web develop...
Writing forward-compatible websites - Developer guides
ipt, when used on the file level, applies to everything in the file. so appending a script that depends on non-strict-mode behavior to a strict-mode script will cause things to break. ask the authors of any javascript libraries you use to also follow these guidelines suggest to the developers of your favorite libraries that they follow these guidelines too. if they don't, you can't rely on that library not breaking in the future. unfortunately, libraries are common transgressors of these guidelines. sniffing sniff for specific features if you plan to use some feature, use object-detection to sniff for that exact feature, if possible. as a simple example, don't assume that any browser in which "filter" in body.style tests true must be microsoft internet explorer and therefore e.g. will have ...
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
raphics in a <canvas> element. see our canvas tutorial to learn more. svg (scalable vector graphics) lets you draw images using commands that draw specific shapes, patterns, and lines to produce an image. svg commands are formatted as xml, and can be embedded directly into a web page or can be placed in he page using the <img> element, just like any other type of image. webgl the web graphics library is an opengl es-based api for drawing high-performance 2d and 3d graphics on the web. see our webgl tutorial to find out more. how to describe a color in order to represent a color in css, you have to find a way to translate the analog concept of "color" into a digital form that a computer can use. this is typically done by breaking down the color into components, such as how much of each of a...
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
Web › HTML › Element › audio
cording is being played, while transcripts allow people who need additional time to be able to review the recording's content at a pace and format that is comfortable for them. if automatic captioning services are used, it is important to review the generated content to ensure it accurately represents the source audio. the <audio> element doesn't directly support webvtt. you will have to find a library or framework that provides the capability for you, or write the code to display captions yourself. one option is to play your audio using a <video> element, which does support webvtt. in addition to spoken dialog, subtitles and transcripts should also identify music and sound effects that communicate important information. this includes emotion and tone. for example, in the webvtt below, note th...
<input type="date"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › date
rmats. so we still have a problem. span { position: relative; } span::after { right: -18px; position: absolute; } input:invalid + span::after { content: '✖'; } input:valid + span::after { content: '✓'; } at the moment, the best way to deal with dates in forms in a cross-browser way is to have the user enter the day, month, and year in separate controls, or to use a javascript library such as jquery date picker. examples in this example, we create 2 sets of ui elements for choosing dates: a native <input type="date"> picker and a set of 3 <select> elements for older browsers that don't support the native date input. html the html looks like so: <form> <div class="nativedatepicker"> <label for="bday">enter your birthday:</label> <input type="date" id="bda...
<input type="datetime-local"> - HTML: Hypertext Markup Language
and minute - even if such a combination is invalid in the user's local time zone (such as times within a daylight saving time spring-forward transition gap). some mobile browsers (particularly on ios) do not currently implement this correctly. because of the limited browser support for datetime-local, and the variations in how the inputs work, it may currently still be best to use a framework or library to present these, or to use a custom input of your own. another option is to use separate date and time inputs, each of which is more widely supported than datetime-local. some browsers may resort to a text-only input element that validates that the results are legitimate date/time values before letting them be delivered to the server, as well, but you shouldn't rely on this behavior since you c...
<select>: The HTML Select element - HTML: Hypertext Markup Language
Web › HTML › Element › select
, and you can use the appearance property to remove the default system appearance. however, these properties don't produce a consistent result across browsers, and it is hard to do things like line different types of form element up with one another in a column. the <select> element's internal structure is complex, and hard to control. if you want to get full control, you should consider using a library with good facilities for styling form widgets, or try rolling your own dropdown menu using non-semantic elements, javascript, and wai-aria to provide semantics. for more useful information on styling <select>, see: styling html forms advanced styling for html forms examples basic select the following example creates a very simple dropdown menu, the second option of which is selected by d...
Using the application cache - HTML: Hypertext Markup Language
ing chrome://appcache-internals/. safari has a similar "empty cache" setting in its preferences but a browser restart may also be required. in firefox, the offline cache data is stored separately from the firefox profile—next to the regular disk cache: windows vista/7: c:\users\<username>\appdata\local\mozilla\firefox\profiles\<salt>.<profile name>\offlinecache mac/linux: /users/<username>/library/caches/firefox/profiles/<salt>.<profile name>/offlinecache in firefox the current status of the offline cache can be inspected on the about:cache page (under the "offline cache device" heading). the offline cache can be cleared for each site separately using the "remove..." button in tools -> options -> advanced -> network -> offline data. prior to firefox 11, neither tools -> clear recent his...
Reason: invalid token ‘xyz’ in CORS header ‘Access-Control-Allow-Headers’ - HTTP
...
Reason: invalid token ‘xyz’ in CORS header ‘Access-Control-Allow-Methods’ - HTTP
as get, post, or head. if any of the specified values are not recognized by the client user agent, this error occurs. this is a problem that most likely can only be fixed on the server side, by modifying the server's configuration to no longer send the invalid or unknown method name with the access-control-allow-methods header. it may also be worth checking to ensure that the user agent or http library you're using on the client is up-to-date. ...
Using HTTP cookies - HTTP
Web › HTTP › Cookies
her ways to store information in the browser another approach to storing data in the browser is the web storage api. the window.sessionstorage and window.localstorage properties correspond to session and permanent cookies in duration, but have larger storage limits than cookies, and are never sent to a server. more structured and larger amounts of data can be stored using the indexeddb api, or a library built on it. other techniques have been created to cause cookies to be recreated after they are deleted, known as "zombie" cookies. these techniques violate the principles of user privacy and user control, may violate data privacy regulations, and could expose a website using them to legal liability. ...
CSP: script-src - HTTP
s such as 'self' or 'unsafe-inline' are ignored. see script-src for an example. 'report-sample' requires a sample of the violating code to be included in the violation report. examples violation case given this csp header: content-security-policy: script-src https://example.com/ the following script is blocked and won't be loaded or executed: <script src="https://not-example.com/js/library.js"></script> note that inline event handlers are blocked as well: <button id="btn" onclick="dosomething()"> you should replace them with addeventlistener calls: document.getelementbyid("btn").addeventlistener('click', dosomething); unsafe inline script note: disallowing inline styles and inline scripts is one of the biggest security wins csp provides. however, if you absolutely have to us...
Protocol upgrade mechanism - HTTP
the new protocol. common uses for this mechanism here we look at the most common use cases for the upgrade header. upgrading to a websocket connection by far, the most common use case for upgrading an http connection is to use websockets, which are always implemented by upgrading an http or https connection. keep in mind that if you're opening a new connection using the websocket api, or any library that does websockets, most or all of this is done for you. for example, opening a websocket connection is as simple as: websocket = new websocket("ws://destination.server.ext", "optionalprotocol"); the websocket() constructor does all the work of creating an initial http/1.1 connection then handling the handshaking and upgrade process for you. you can also use the "wss://" url scheme to open ...
JavaScript data types and data structures - JavaScript
data is available to any script running in the same context. maps and weakmaps make it easy to privately bind data to an object. structured data: json json (javascript object notation) is a lightweight data-interchange format, derived from javascript, but used by many programming languages. json builds universal data structures. see json and json for more details. more objects in the standard library javascript has a standard library of built-in objects. please have a look at the reference to find out about more objects. determining types using the typeof operator the typeof operator can help you to find the type of your variable. please read the reference page for more details and edge cases. specifications specification ecmascript (ecma-262)the definition of 'ec...
Introduction - JavaScript
advanced server side versions of javascript such as node.js, which allow you to add more functionality to a website than simply downloading files (such as realtime collaboration between multiple computers). inside a host environment (for example, a web browser), javascript can be connected to the objects of its environment to provide programmatic control over them. javascript contains a standard library of objects, such as array, date, and math, and a core set of language elements such as operators, control structures, and statements. core javascript can be extended for a variety of purposes by supplementing it with additional objects; for example: client-side javascript extends the core language by supplying objects to control a browser and its document object model (dom). for example, clien...
JavaScript modules - JavaScript
ks that enable module usage (for example, other commonjs and amd-based module systems like requirejs, and more recently webpack and babel). the good news is that modern browsers have started to support module functionality natively, and this is what this article is all about. this can only be a good thing — browsers can optimize loading of modules, making it more efficient than having to use a library and do all of that extra client-side processing and extra round trips. browser support use of native javascript modules is dependent on the import and export statements; these are supported in browsers as follows: import desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsimpor...
TypeError: cyclic object value - JavaScript
draft exists), hence json.stringify() doesn't try to solve them and fails accordingly. examples circular references in a circular structure like the following var circularreference = {otherdata: 123}; circularreference.myself = circularreference; json.stringify() will fail json.stringify(circularreference); // typeerror: cyclic object value to serialize circular references you can use a library that supports them (e.g. cycle.js) or implement a solution by yourself, which will require finding and replacing (or removing) the cyclic references by serializable values. the snippet below illustrates how to find and filter (thus causing data loss) a cyclic reference by using the replacer parameter of json.stringify(): const getcircularreplacer = () => { const seen = new weakset(); return...
TypeError: "x" is not a function - JavaScript
ing the latter will throw an error: const sixteen = 2(3 + 5); alert('2 x (3 + 5) is ' + string(sixteen)); //uncaught typeerror: 2 is not a function you can correct the code by adding a * operator: const sixteen = 2 * (3 + 5); alert('2 x (3 + 5) is ' + string(sixteen)); //2 x (3 + 5) is 16 import the exported module correctly ensure you are importing the module correctly. ...
ReferenceError: "x" is not defined - JavaScript
the javascript exception "variable is not defined" occurs when there is a non-existent variable referenced somewhere. message referenceerror: "x" is not defined error type referenceerror. what went wrong? there is a non-existent variable referenced somewhere. this variable needs to be declared, or you need to make sure it is available in your current script or scope. note: when loading a library (such as jquery), make sure it is loaded before you access library variables, such as "$". put the <script> tag that loads the library before your code that uses it. examples variable not declared foo.substring(1); // referenceerror: foo is not defined the "foo" variable isn't defined anywhere. it needs to be some string, so that the string.prototype.substring() method will work. var foo =...
Array.prototype.sort() - JavaScript
specifications specification ecmascript (ecma-262)the definition of 'array.prototype.sort' in that specification. ...
DataView - JavaScript
tleendian); // combine the two 32-bit values const combined = littleendian? left + 2**32*right : 2**32*left + right; if (!number.issafeinteger(combined)) console.warn(combined, 'exceeds max_safe_integer. precision may be lost'); return combined; } alternatively, if you need full 64-bit range, you can create a bigint. further, although native bigints are much faster than user-land library equivalents, bigints will always be much slower than 32-bit integers in javascript due to the nature of their variable size. const bigint = window.bigint, bigthirtytwo = bigint(32), bigzero = bigint(0); function getuint64bigint(dataview, byteoffset, littleendian) { // split 64-bit number into two 32-bit (4-byte) parts const left = bigint(dataview.getuint32(byteoffset|0, !!littleendian)>>>0);...
Date.parse() - JavaScript
er of milliseconds since january 1, 1970, 00:00:00 utc or nan if the string is unrecognized or, in some cases, contains illegal date values (e.g. 2015-02-31). it is not recommended to use date.parse as until es5, parsing of strings was entirely implementation dependent. there are still many differences in how different hosts parse date strings, therefore date strings should be manually parsed (a library can help if many different formats are to be accommodated). the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax direct call: date.parse(datestring) implicit call: new date(datestring) parameters datestring ...
FinalizationRegistry - JavaScript
ly different situation with the same version of the same engine. garbage collection is a hard problem that javascript engine implementers are constantly refining and improving their solutions to. here are some specific points that the authors of the weakref proposal that finalizationregistry is part of included in its explainer document: garbage collectors are complicated. if an application or library depends on gc cleaning up a finalizationregistry or calling a finalizer [cleanup callback] in a timely, predictable manner, it's likely to be disappointed: the cleanup may happen much later than expected, or not at all. sources of variability include: one object might be garbage-collected much sooner than another object, even if they become unreachable at the same time, e.g., due to generation...
JSON.stringify() - JavaScript
format doesn't support object references (although an ietf draft exists), a typeerror will be thrown if one attempts to encode an object with circular references. const circularreference = {}; circularreference.myself = circularreference; // serializing circular references throws "typeerror: cyclic object value" json.stringify(circularreference); to serialize circular references you can use a library that supports them (e.g. cycle.js by douglas crockford) or implement a solution by yourself, which will require finding and replacing (or removing) the cyclic references by serializable values. issue with plain json.stringify for use as javascript historically, json was not a completely strict subset of javascript. the literal code points u+2028 line separator and u+2029 paragraph separator cou...
Number.isSafeInteger() - JavaScript
integer 253 + 1 can't be directly represented in ieee-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. the safe integers consist of all integers from -(253 - 1) inclusive to 253 - 1 inclusive (± 9007199254740991 or ± 9,007,199,254,740,991). handling values larger or smaller than ~9 quadrillion with full precision requires using an arbitrary precision arithmetic library. see what every programmer needs to know about floating point arithmetic for more information on floating point representations of numbers. for larger integers, consider using the bigint type. syntax number.issafeinteger(testvalue) parameters testvalue the value to be tested for being a safe integer. return value a boolean indicating whether or not the given value is a number that is ...
Symbol.for() - JavaScript
...
WeakRef - JavaScript
the same engine, or even in a slightly different situation with the same version of the same engine. garbage collection is a hard problem that javascript engine implementers are constantly refining and improving their solutions to. here are some specific points that the authors of the weakref proposal included in its explainer document: garbage collectors are complicated. if an application or library depends on gc cleaning up a weakref or calling a finalizer [cleanup callback] in a timely, predictable manner, it's likely to be disappointed: the cleanup may happen much later than expected, or not at all. sources of variability include: one object might be garbage-collected much sooner than another object, even if they become unreachable at the same time, e.g., due to generational collection...
Authoring MathML - MathML
to provide some fallback rendering. if you need only basic mathematical constructions such as those used on this mdn wiki then a small mathml.css stylesheet might be enough. to use it, just insert one line in your document header: <script src="https://fred-wang.github.io/mathml.css/mspace.js"></script> if you need more complex constructions, you might instead consider using the heavier mathjax library as a mathml polyfill: <script src="https://fred-wang.github.io/mathjax.js/mpadded-min.js"></script> note that these two scripts perform feature detection of the mspace or mpadded elements (see the browser compatibility table on these pages). there is also a similar script to display a warning at the top of the page for browsers without good mathml support and let the users choose between one of...
Performance budgets - Web Performance
timing based (e.g. time to interactive, first contentful paint). quantity-based (e.g. amount of js files/total image size). rule-based (e.g. pagespeed index, lighthouse score). their primary goal is to prevent regressions, but they can provide insights to forecast trends (i.e. on september, 50% of the budget was spent in a week). additionally, it can uncover development needs (i.e. a large library with smaller alternatives is often picked to solve a common problem). how do i define a performance budget? a budget should include 2 levels: warning. error. the warning level allows you to be proactive and plan any tech debt, while not blocking development or deploys. the error level is an upper bound limit, where changes will have a negative and noticeable impact. in order to begin, y...
The building blocks of responsive design - Progressive web apps (PWAs)
future date. our desktop layout for snapshot is three columns, containing the camera viewer, image capture view, and gallery, respectively. the markup is very simple: <x-deck selected-index="0"> <x-card> … </x-card> <x-card> … </x-card> <x-card> … </x-card> </x-deck> note: these weird x- elements may be unfamiliar; they are part of brick, mozilla's ui element library for mobile web apps. we have used brick to create the mobile layout for snapshot, which you will read more about below. to get these sitting side-by-side we have used the following rules: x-card { width: 100%; } x-card:nth-child(1), x-card:nth-child(2) { width: 30%; float: left; padding: 2rem; } x-card:nth-child(3) { width: 40%; float: left; height: 100%; overflow: auto; pa...
Progressive web apps (PWAs)
— learn the basics of responsive design, an essential topic for modern app layout. mobile first — often when creating responsive application layouts, it makes sense to create the mobile layout as the default, and build wider layouts on top. add to home screen guide — learn how your apps can take advantage of add to home screen (a2hs). tools localforage — a nice simple javascript library for making client-side data storage really simple; it uses indexeddb by default and falls back to web sql/web storage if necessary. serviceworkerware — an express-like microframework for easy service worker development. oghliner — not only a template but a tool for deploying offline web apps to github pages. sw-precache — a node module to generate service worker code that will precache s...
SVG documentation index - SVG: Scalable Vector Graphics
Web › SVG › Index
together, or filtered to change their appearance completely. 279 other content in svg intermediate, svg, svg:tutorial apart from graphic primitives like rectangles and circles, svg offers a set of elements to embed other types of content in images as well. 280 paths intermediate, svg, svg:tutorial the <path> element is the most powerful element in the svg library of basic shapes. it can be used to create lines, curves, arcs, and more. 281 patterns advanced, svg, svg:tutorial patterns are arguably one of the more confusing fill types to use in svg. they're also very powerful, so they're worth talking about and getting at least a fundamental grasp on. like gradients, the <pattern> element should be put in the <defs> section of your svg ...
Paths - SVG: Scalable Vector Graphics
Web › SVG › Tutorial › Paths
it can be used to create lines, curves, arcs, and more. paths create complex shapes by combining multiple straight lines or curved lines. complex shapes composed only of straight lines can be created as <polyline>s. while <polyline>s and <path>s can create similar-looking shapes, <polyline>s require a lot of small straight lines to simulate curves, and don't scale well to larger sizes. a good understanding of paths is important when drawing svgs. ...
Tools for SVG - SVG: Scalable Vector Graphics
lanned for svg 1.2. batik offers a viewer (squiggle), a rasterizer for png output, an svg pretty printer to format svg files, and a truetype-to-svg-font converter. together with apache fop batik can transform svg to pdf. other renderers several projects exist that can create a raster image from an svg source. imagemagick is one of the most famous command-line image processing tools. the gnome library rsvg is used by the wikipedia to raster their svg graphics. usage of headless browsers such as slimerjs and phantomjs are also popular for this purpose, as the image produced is closer to what the svg will look like in the browser. raphael js url: raphaeljs.com this is a javascript library, that acts as an abstraction layer between browser implementations. notably older versions of internet ex...
SVG: Scalable Vector Graphics
Web › SVG
firefox extension (grafox) to add a subset of smil animation support interactive photos manipulation html transformations using svg's foreignobject mapping, charting, games & 3d experiments while a little svg can go a long way to enhanced web content, here are some examples of heavy svg usage. connect 4 jvectormap (interactive maps for data visualization) jointjs (javascript diagramming library) d3 ( javascript library for visualizing data with html, svg, and css ) ...
current - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the current function can be used to get the context node in an xslt instruction. syntax current() returns a node-set containing only the current node. notes this function is an xslt-specific addition to xpath. it is not a part of the core xpath function library. for an outermost expression (an expression not occurring within another expression), the current node is always the same as the context node (which will be returned by the . or self syntax). the following two are symantically equivalent. <xsl:value-of select="current()"/> <xsl:value-of select="."/> in an inner expression (e.g. in square brackets), the current node is still the same as it would have been in an outermost expression.
document - XPath
all) and the resulting node-sets had been concatenated into a single node-set. other specific conditions exist with specified behaviors. see the xslt 1.0 documentation for details. since the uri is relative to the xsl document, document("") would return the root node of the current document. this function is an xslt-specific addition to xpath. it is not a part of the core xpath function library. defined xslt 1.0 12.1 gecko support supported. ...
format-number - XPath
s not available online. here is the java se 6 decimalformat.) decimal-format (optional) the name of an xsl:decimal-format element that defines the number format to be used. if omitted, the default decimal-format will be used. returns a string representing the number in the new format. notes this function is an xslt-specific addition to xpath. it is not a part of the core xpath function library. defined xslt 1.0 12.3 gecko support supported. ...
generate-id - XPath
set. if omitted, the current context node will be used. returns a string containing the generated id. notes the same id must be generated every time for the same node in the current document in the current transformation. the generated id may not be the same in subsequent transformations. this function is an xslt-specific addition to xpath. it is not a part of the core xpath function library. defined xslt 1.0 12.4 gecko support supported. ...
key - XPath
Web › XPath › Functions › key
keyname a string containing the name of the xsl:key element to be used. value the returned node-set will contain every node that has this value for the given key. returns a node set. notes the xsl:key element defines what attribute on what given elements will be used to match the key. this function is an xslt-specific addition to xpath. it is not a part of the core xpath function library. defined xslt 1.0 12.2 gecko support supported. ...
PI Parameters - XSLT: Extensible Stylesheet Language Transformations
pression in the select attribute. the context node is the node used as initial current node used when executing the stylesheet. the context position is the position of the context node in the initial current node list used when executing the stylesheet. the context size is the size of the initial current node list used when executing the stylesheet. no variables are available. the function library is the standard xpath function library. the namespace declarations are determined by the xslt-param-namespace pis, see below. if the select attribute fails to parse or execute, the pi is ignored (in particular, it does not fall back to the value attribute). xslt-param-namespace the xslt-param-namespace uses two attributes: prefix the prefix that is mapped. namespace the namespace the...
Compiling a New C/C++ Module to WebAssembly - WebAssembly
extern "c" { #endif void emscripten_keepalive myfunction(int argc, char ** argv) { printf("myfunction called\n"); } #ifdef __cplusplus } #endif by default, emscripten-generated code always just calls the main() function, and other functions are eliminated as dead code. putting emscripten_keepalive before a function name stops this from happening. you also need to import the emscripten.h library to use emscripten_keepalive. note: we are including the #ifdef blocks so that if you are trying to include this in c++ code, the example will still work. due to c versus c++ name mangling rules, this would otherwise break, but here we are setting it so that it treats it as an external c function if you are using c++. now add html_template/shell_minimal.html into this new directory ...
Understanding WebAssembly text format - WebAssembly
to the underlying bytecode it represents — and the wrapper objects representing wasm in javascript. note: this is potentially overkill if you are a web developer who just wants to load a wasm module into a page and use it in your code (see using the webassembly javascript api), but it is more useful if for example, you want to write wasm modules to optimize the performance of your javascript library, or build your own webassembly compiler. s-expressions in both the binary and textual formats, the fundamental unit of code in webassembly is a module. in the text format, a module is represented as one big s-expression. s-expressions are a very old and very simple textual format for representing trees, and thus we can think of a module as a tree of nodes that describe the module’s structu...
Compiling an Existing C Module to WebAssembly - WebAssembly
emscripten provides most of these features, although there are some limitations. as an example, let's compile an encoder for webp to wasm. the source for the webp codec is written in c and available on github as well as some extensive api documentation. that's a pretty good starting point. ...