Search completed in 1.07 seconds.
650 results for "register":
Your results are loading. Please wait...
Navigator.registerProtocolHandler() - Web APIs
the navigator method registerprotocolhandler() lets web sites register their ability to open or handle particular url schemes (aka protocols).
... syntax navigator.registerprotocolhandler(scheme, url, title); note: recently updated to navigator.registerprotocolhandler(scheme, url), but no browsers currently support this version.
...for example, you can register to handle sms text message links by passing the "sms" scheme.
...And 7 more matches
FinalizationRegistry.prototype.unregister() - JavaScript
the unregister unregisters a target object from a finalizationregistry instance.
... syntax registry.unregister(unregistertoken); parameters unregistertoken the token used with the register method when registering the target object.
... notes when a target object has been reclaimed, it is no longer registered in the registry.
...And 7 more matches
registerChrome - Archive of obsolete content
registerchrome registers chrome with the chrome registry.
... method of install object syntax int registerchrome( switch, srcdir, xpipath); parameters the registerchrome method has the following parameters: switch switch is the chrome switch indicating what type of file is being registered.
... skin is used to register skins, locale is used to register language packs.
...And 6 more matches
AudioWorkletGlobalScope.registerProcessor - Web APIs
the registerprocessor method of the audioworkletglobalscope interface registers a class constructor derived from audioworkletprocessor interface under a specified name.
... syntax audioworkletglobalscope.registerprocessor(name, processorctor); parameters name a string representing the name under which the processor will be registered.
... note: a key-value pair { name: constructor } is saved internally in the audioworkletglobalscope once the processor is registered.
...And 6 more matches
ServiceWorkerContainer.register() - Web APIs
the register() method of the serviceworkercontainer interface creates or updates a serviceworkerregistration for the given scripturl.
... syntax serviceworkercontainer.register(scripturl, options) .then(function(serviceworkerregistration) { ...
...the registered service worker file needs to have a valid javascript mime type.
...And 5 more matches
CSS.registerProperty() - Web APIs
the css.registerproperty() method registers custom properties, allowing for property type checking, default values, and properties that do or do not inherit their value.
... registering a custom property allows you to tell the browser how the custom property should behave; what are allowed types, whether the custom property inherits its value, and what the default value of the custom property is.
... syntax css.registerproperty(propertydefinition); parameters a propertydefinition dictionary object, which can contain the following members: name a domstring indicating the name of the property being defined.
...And 4 more matches
Navigator.registerContentHandler() - Web APIs
allows web sites to register themselves as possible handlers for content of a particular mime type.
... note: web sites may only register content handlers for themselves.
... for security reasons, it's not possible for an extension or web site to register content handlers targeting other sites.
...And 4 more matches
PaintWorklet.registerPaint - Web APIs
the paintworklet.registerpaint() method of the paintworklet interface registers a class programmatically generate an image where a css property expects a file.
... syntax registerpaint(name, class); parameters name the name of the worklet class to register.
... examples the following shows registering an example worklet module.
...And 4 more matches
PushManager.unregister() - Web APIs
the unregister() method was used to ask the system to unregister and delete the specified endpoint.
... in the updated api, a subscription is can be unregistered via the pushsubscription.unsubscribe() method.
... syntax var request = navigator.push.unregister(pushendpoint); properties pushendpoint a pushendpoint to be unregistered.
...And 4 more matches
ServiceWorkerRegistration.unregister() - Web APIs
the unregister() method of the serviceworkerregistration interface unregisters the service worker registration and returns a promise.
... the promise will resolve to false if no registration was found, otherwise it resolves to true irrespective of whether unregistration happened or not (it may not unregister if someone else just called serviceworkercontainer.register() with the same scope.) the service worker will finish any ongoing operations before it is unregistered.
... syntax serviceworkerregistration.unregister().then(function(boolean) { }); parameters none.
...And 2 more matches
FinalizationRegistry.prototype.register() - JavaScript
the register() method registers an object with a finalizationregistry instance so that if the object is garbage-collected, the registry's callback may get called.
... syntax registry.register(target, heldvalue, [unregistertoken]); parameters target the target object to register.
... unregistertoken optional a token that may be used with the unregister method later to unregister the target object.
...And 2 more matches
Document.registerElement() - Web APIs
warning: document.registerelement() is deprecated in favor of customelements.define().
... the document.registerelement() method registers a new custom element in the browser and returns a constructor for the new element.
... syntax var constructor = document.registerelement(tag-name, options); parameters tag-name the name of the custom element.
... example here is a very simple example: var mytag = document.registerelement('my-tag'); now the new tag is registered in the browser.
PushManager.register() - Web APIs
the register method is used to ask the system to request a new endpoint for notifications.
... syntax var request = navigator.push.register(); return a domrequest object to handle the success or failure of the method call.
... note: if you do not need the url any more, please use pushmanager.unregister() to clean up after yourself.
... example var req = navigator.push.register(); req.onsuccess = function(e) { var endpoint = req.result; debug("new endpoint: " + endpoint ); } req.onerror = function(e) { debug("error getting a new endpoint: " + json.stringify(e)); } specification specification status comment push api working draft defines the pushmanager interface.
windowsRegisterServer - Archive of obsolete content
summary windowsregisterserver registers installed dlls with the windows registry.
... method of file object syntax int windowsregisterserver( object localdirspec ) parameters the windowsregisterserver method has the following parameters: localdirspec a filespecobject representing a directory obtained by getcomponentfolder or getfolder.
... example filecdtool = getfolder("file:///", faod + "cdtool.dll"); err = file.windowsregisterserver(filecdtool); ...
deleteRegisteredFile - Archive of obsolete content
deleteregisteredfile (netscape 6 and mozilla do not currently support this method.) deletes the specified file and removes its entry from the client version registry.
... method of install object syntax int deleteregisteredfile (string registryname); parameters the deleteregisteredfile method has the following parameter: registryname the pathname in the client version registry for the file that is to be deleted.
...description the deleteregisteredfile method deletes the specified file and removes the file's entry from the client version registry.
SyncManager.register() - Web APIs
the syncmanager.register method of the syncmanager interface returns a promise that resolves to a syncregistration instance.
... syntax syncmanager.register([options]).then(function(syncregistration) { ...
autoRegister
this content is now available at nsicomponentregistrar.autoregister().
autoUnregister
this content is now available at nsicomponentregistrar.autounregister().
isCIDRegistered
this content is now available at nsicomponentregistrar.iscidregistered().
isContractIDRegistered
this content is now available at nsicomponentregistrar.iscontractidregistered().
registerFactory
this content is now available at nsicomponentregistrar.registerfactory().
registerFactoryLocation
this content is now available at nsicomponentregistrar.registerfactorylocation().
unregisterFactory
this content is now available at nsicomponentregistrar.unregisterfactory().
unregisterFactoryLocation
this content is now available at nsicomponentregistrar.unregisterfactorylocation().
registerProvider
this content is now available at nsidirectoryservice.registerprovider().
unregisterProvider
this content is now available at nsidirectoryservice.unregisterprovider().
registerSelf
this content is now available at nsimodule.registerself().
unregisterSelf
this content is now available at nsimodule.unregisterself().
nsIComponentRegistrar
inherits from: nsisupports last changed in gecko 1.0 method overview void autoregister(in nsifile aspec); void autounregister(in nsifile aspec); string cidtocontractid(in nscidref aclass); nscidptr contractidtocid(in string acontractid); nsisimpleenumerator enumeratecids(); nsisimpleenumerator enumeratecontractids(); boolean iscidregistered(in nscidref aclass); boolean iscontractidregistered(in string acontractid); void registerfactory(in nscidref aclass, in string aclassname, in string acontractid, in nsifactory afactory); void registerfactorylocation(in nscidref aclass, in string aclassname, in string acontractid, in nsifile ...
...afile, in string aloaderstr, in string atype); void unregisterfactory(in nscidref aclass, in nsifactory afactory); void unregisterfactorylocation(in nscidref aclass, in nsifile afile); methods autoregister() register a component (.manifest) file or all component files in a directory.
...note: formerly this method would register component files directly.
...And 38 more matches
platform/xpcom - Archive of obsolete content
usage the xpcom module makes it simpler to perform three main tasks: implement xpcom object interfaces implement and register xpcom factories implement and register xpcom services if all you need to do is use xpcom objects that someone else has implemented, then you don't need to use this module.
... getservice(ci.nsiobserverservice); var starobserver = class({ extends: unknown, interfaces: [ 'nsiobserver' ], topic: '*', register: function register() { observerservice.addobserver(this, this.topic, false); }, unregister: function() { observerservice.removeobserver(this, this.topic); }, observe: function observe(subject, topic, data) { console.log('star observer:', subject, topic, data); } }); var starobserver = starobserver(); starobserver.register(); implementing xpcom factories the xpcom module e...
...you can use this class to register factories for xpcom components you have defined.
...And 36 more matches
Creating the Component Code
having the component found and registered properly is the goal of this first chapter of the tutorial.
... component registration all xpcom components - whether they're stored in shared libraries (dlls, dsos, dylibs), javascript files, or otherwise - need to be registered before they can be used.
... the weblock component must do a number of things to register itself.
...And 31 more matches
Index
MozillaTechXPCOMIndex
unless otherwise noted you register for the topics using the nsiobserverservice.
... 78 troubleshooting xpcom components registration add-ons, extensions, xpcom often the first time you create an xpcom component, it may fail to register correctly.
...having the component found and registered properly is the goal of this first chapter of the tutorial.
...And 31 more matches
Index - Web APIs
WebAPIIndex
204 audioworkletglobalscope.registerprocessor api, audio, audioworkletglobalscope, audioworkletprocessor, method, reference, web audio api the registerprocessor method of the audioworkletglobalscope interface registers a class constructor derived from audioworkletprocessor interface under a specified name.
... 387 css.registerproperty css, houdini, reference registering a custom property allows you to tell the browser how the custom property should behave; what are allowed types, whether the custom property inherits its value, and what the default value of the custom property is.
... 694 customelementregistry api, customelementregistry, experimental, interface, landing, reference, web components, custom elements the customelementregistry interface provides methods for registering custom elements and querying registered elements.
...And 28 more matches
CustomizableUI.jsm
areas are registered using the registerarea method and unregistered using the unregisterarea method.
... when a customizable toolbar's xbl binding is constructed (generally, that is when a <toolbar customizable="true"/> node is appended to the document and isn't invisible), the binding will call into customizableui and register the toolbar's node as being one of the concrete instances of its area.
...in order to register such a toolbar, set the 'overflowable' property to true, and provide the id of the anchor in the 'anchor' property.
...And 24 more matches
Component Internals
if there are new components, xpcom registers them: xpcom calls autoregistration start.
... xpcom registers new components.
...there are two types of manifests that xpcom uses to track components: component manifests when xpcom first starts up, it looks for the component manifest, which is a file that lists all registered components, and stores details on exactly what each component can do.
...And 18 more matches
Starting WebLock
in order to be started up or notified when some event happens, the sample component has to hook into mozilla, which it can do either by overriding an existing component or by registering for some event that will cause it to start up.
...when a gecko application starts up, registered components are created and notified via the general-purpose observer interface nsiobserver.
...for example, an object may be created and have its observe method called at startup, or it may register to be notified prior to xpcom shutdown.
...And 18 more matches
L20n Javascript API
alternatively, you can register callbacks to execute when the context is ready (or when globals change and translations need to be updated) with ctx.localize.
... ctx.localize(['hello', 'new'], function(l10n) { var node = document.queryselector('[data-l10n-id=hello]'); node.textcontent = l10n.entities.hello.value; node.classlist.remove('hidden'); }); ctx.registerlocales(defaultlocale: string?, availablelocales: array<string>?) register the default locale of the context instance, as well as all other locales available to the context instance before the language negotiation.
... ctx.registerlocales('en-us', ['ar', 'es-ar', 'es-es', 'en-us', 'fr', 'pl']); defaultlocale is the original language of the context instance and will be used as the last fallback locale if other locales are registered.
...And 16 more matches
Install script template - Archive of obsolete content
ry install } function writeplidsolution() { //concatenate the secondary install path with the filename to make a fully qualified pathname var qualifiedsecondaryfolderdll = secondaryfolder + plugin_file; var qualifiedsecondaryfolderxpt = secondaryfolder + component_file; // write plid keys (mozilla.org/projects/plugins/first-install-problem.html) // write plid keys to hklm var hklm_status = registerplid(hkey_local_machine, reg_moz_path, plid, qualifiedsecondaryfolderdll, qualifiedsecondaryfolderxpt, plugin_description, company_name, software_name, version, mimetype, suffix, suffix_description); logcomment("moz first install installation: registerplid("+hkey_local_machine+") returned, status "+hklm_status); if (hklm_status == false) { // wr...
...ite plid keys (mozilla.org/projects/plugins/first-install-problem.html) // write plid keys to hkcu var hkcu_status = registerplid(hkey_current_user, reg_moz_path, plid, qualifiedsecondaryfolderdll, qualifiedsecondaryfolderxpt, plugin_description, company_name, software_name, version, mimetype, suffix, suffix_description); logcomment("first install installation: registerplid("+hkey_current_user+") returned, status "+hklm_status); if (hkcu_status != 0) { logcomment("could not write to the registry.
....my files) * @param suffixdescription string describing suffix **/ function registerplid(rootkey, plidpath, plidid, dllabsolutepath, xptabsolutepath, plugindescription, vendor, productname, pluginversion, mimetype, suffix, suffixdescription) { var myregstatus = 0; winreg = getwinregistry(); if (winreg == null) { logcomment("moz registerplid: winreg == null"); return winregisnullerror; } // which root to start from hklm, hkcu if (rootkey =...
...And 15 more matches
DevTools API - Firefox Developer Tools
introduction the devtools api provides a way to register and access developer tools in firefox.
... in terms of user interface, each registered tool lives in its own tab (we call one tab a panel).
...the gdevtools global object provides methods to register a tool definition and to access tool instances.
...And 15 more matches
Using Objective-C from js-ctypes
register the alloc selector for the message.
... class objc_getclass(const char *name); in /usr/include/objc/objc.h, class is defined as an opaque type by the following: typedef struct objc_class *class; in this example, we need the classnsspeechsynthesizer, which is retrieved with the following code: class nsspeechsynthesizer = objc_getclass("nsspeechsynthesizer"); registering a selector selectors can be registered and retrieved with sel_registername function, also declared in /usr/include/objc/runtime.h.
... sel_registername receives the name of the selector, and returns the selector.
...And 14 more matches
Using the CSS Painting API - Web APIs
to programmatically create an image used by a css stylesheet we need to work through a few steps: define a paint worklet using the registerpaint() function register the worklet include the paint() css function to elaborate over these steps, we're going to start by creating a half-highlight background, like on this header: css paint worklet in an external script file, we employ the registerpaint() function to name our css paint worklet.
... registerpaint('headerhighlight', class { /* define if alphatransparency is allowed alpha is set to true by default.
... using the paint worklet to use the paint worklet, we need to register it using addmodule() and include it in our css, ensuring the css selector matches a dom node in our html registering the worklet the setup and design of our paint worklet took place in the external script shown above.
...And 14 more matches
Installer Script - Archive of obsolete content
registerchrome(content | delayed_chrome, getfolder(cf,"toolkit.xpi"),"content/global/"); 44.
... registerchrome(content | delayed_chrome, getfolder(cf,"browser.xpi"),"content/communicator/"); 45.
... registerchrome(content | delayed_chrome, getfolder(cf,"browser.xpi"),"content/editor/"); 46.
...And 13 more matches
Using the CSS properties and values API - Web APIs
registering a custom property registering a custom property allows you to tell the browser how the custom property should behave; what are allowed types, whether the custom property inherits its value, and what the default value of the custom property is.
... there are two ways to register a property, in javascript or in css.
... css.registerproperty the following will register a css custom properties, --my-prop, using css.registerproperty, as a color, give it a default value, and have it not inherit its value: window.css.registerproperty({ name: '--my-prop', syntax: '<color>', inherits: false, initialvalue: '#c0ffee', }); @property the same registration can take place in css.
...And 13 more matches
Chrome registration
if the above example had a packagename of camelcasepackage, you would get an error message similar to "no chrome registered for chrome://camelcasepackage/path/to/files".
... binary-component binary-component components/mycomponent.dll [flags] instructs mozilla to register and use a binary component.
...prior to firefox 4, files in the components directory were registered automatically.
...And 12 more matches
Multiprocess on Windows
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.
... ensuring typelib registration for interceptors to be able to use the typelibs, they must be registered.
... any typelibs that are already registered in the system registry will automatically be available for use by the interceptor.
...And 11 more matches
Limitations of chrome scripts
nsicontentpolicy without the shim in multiprocess firefox, if you register the nsicontentpolicy in the chrome process then it will never see any attempts to load web content, because they happen in the content process.
...it transparently registers an nsicontentpolicy in the content process, whose shouldload just forwards to the chrome process.
... to make the shim unnecessary: define and register nsicontentpolicy in the content process.
...And 11 more matches
EventTarget.addEventListener() - Web APIs
the available options are: capture a boolean indicating that events of this type will be dispatched to the registered listener before being dispatched to any eventtarget beneath it in the dom tree.
... usecapture optional a boolean indicating whether events of this type will be dispatched to the registered listener before being dispatched to any eventtarget beneath it in the dom tree.
...event bubbling and capturing are two ways of propagating events that occur in an element that is nested within another element, when both elements have registered a handle for that event.
...And 11 more matches
nsIErrorService
inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/xpcom/error-service;1 method overview string geterrorstringbundle(in short errormodule); string geterrorstringbundlekey(in nsresult error); void registererrorstringbundle(in short errormodule, in string stringbundleurl); void registererrorstringbundlekey(in nsresult error, in string stringbundlekey); void unregistererrorstringbundle(in short errormodule); void unregistererrorstringbundlekey(in nsresult error); methods geterrorstringbundle() retrieves a string bundle url for an error module.
... string geterrorstringbundle( in short errormodule ); parameters errormodule the module for which the string bundle is registered.
... return value the url of the string bundle registered for that module.
...And 10 more matches
Setting HTTP request headers
and once the observer is registered for a topic, it will get notified about the topic by having its observe method called.
...registering after we've created the observer, we need to register it.
... in our case, we want to register it for the "http-on-modify-request" topic.
...And 10 more matches
Using Service Workers - Web APIs
this article provides information on getting started with service workers, including basic architecture, registering a service worker, the install and activation process for a new service worker, updating your service worker, cache control and custom responses, all in the context of a simple app with offline functionality.
... basic architecture with service workers, the following steps are generally observed for basic set up: the service worker url is fetched and registered via serviceworkercontainer.register().
... the service worker will now control pages, but only those opened after the register() is successful.
...And 10 more matches
Index - Archive of obsolete content
110 system/unload register callbacks that are called when a module is unloaded.
... 226 custom about: urls about: this page describes how to register a new about: url for your extension.
... 383 creating a firefox sidebar extension add-ons, extensions, firefox, obsolete this article describes how to create a registered sidebar for firefox 2 or greater.
...And 9 more matches
Learn XPI Installer Scripting by Example - Archive of obsolete content
most installation scripts, including the one discussed here, take the following basic form (in pseudo-code and with links to the sections in which these installation steps are documented): initinstall(); if (verify_space()) { err = add_dirs_and_files; register_files; if (err==success) { performinstall() }; else { cancelinstall() }; } as you can see in the code listing, the verification process at the top is on lines 1 to 18; the file addition process, here part of the main installation block, is on lines 24 to 41; the registration part of the main installation block is on lines 42-58; and the execution at the end of the main block is on lines ...
...if you choose not to register the installed software or do the verifications at the front end of the installation, then at a minimum, the install scripts mustinitialize, add the files to be installed, and execute.
... registering the software registering software is sometimes a requirement of both the operating system and of the netscape 6 platform.
...And 9 more matches
Introduction to events - Learn web development
when such a block of code is defined to run in response to an event, we say we are registering an event handler.
...the node.js event model relies on listeners to listen for events and emitters to emit events periodically — it doesn't sound that different, but the code is quite different, making use of functions like on() to register an event listener, and once() to register an event listener that unregisters after it has run once.
...note: it doesn't work if you try to register this event handler on the button itself — we've had to register it on the window object, which represents the entire browser window.
...And 9 more matches
XPCOM changes in Gecko 2.0
documentation will be updated as time allows to remove references to interfaces being "frozen" or "unfrozen." component registration the way xpcom components are registered changed in gecko 2.
... prior to gecko 2, during component registration, all binary and javascript component files were loaded and called, asking them to register themselves.
...starting in gecko 2, however, components are registered using manifest files, similarly to how chrome is registered.
...And 9 more matches
nsIWindowMediator
nsisimpleenumerator getzorderdomwindowenumerator(in wstring awindowtype, in boolean afronttoback); nsisimpleenumerator getzorderxulwindowenumerator(in wstring awindowtype, in boolean afronttoback); void registerwindow(in nsixulwindow awindow); native code only!
... void unregisterwindow(in nsixulwindow awindow); native code only!
... methods addlistener() register a listener for window status changes.
...And 9 more matches
Plug-in Basics - Plugins
with the plug-in api, you can create dynamically loaded plug-ins that can: register one or more mime types draw into a part of a browser window receive keyboard and mouse events obtain data from the network using urls post data to urls add hyperlinks or hotspots that link to new urls draw into sections on an html page communicate with javascript/dom from native code you can see which plug-ins are installed on your system and have been properly associated with the browse...
... when the browser encounters a mime type, it always searches for a registered plug-in first.
...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.
...And 8 more matches
FinalizationRegistry - JavaScript
description finalizationregistry provides a way to request that a cleanup callback get called at some point when an object registered with the registry has been reclaimed (garbage-collected).
...}); then you register any objects you want a cleanup callback for by calling the `register` method, passing in the object and a *held value* for it: registry.register(theobject, "some value"); the registry does not keep a strong reference to the object, as that would defeat the purpose (if the registry held it strongly, the object would never be reclaimed).
... if you might want to unregister an object later, you pass a third value, which is the unregistration token you'll use later when calling the registry's unregister function to unregister the object.
...And 8 more matches
JavaScript Client API - Archive of obsolete content
getting your tracker to track changes in the underlying data is probably easiest to do if you register your tracker as an observer, so that it can receive notifications from one or more mozilla components.
...you can find out more about registering as an observer here: [link].
... function footracker(name) { tracker.call(this, name); // register yourself as event listener or observer for whatever // you want to track.
...And 7 more matches
Observer Notifications
unless otherwise noted you register for the topics using the nsiobserverservice.
... if your component requires access to the user profile, or any services which require access to the profile (preferences, bookmarks, and so on) then a common pattern is to register with the nsicategorymanager for the app-startup topic which can be done in the component's registration code, and then in that notification register with the observer service for the profile-after-change notification.
... starting in firefox 3.5 components can simply register for the profile-after-change notification in nsicategorymanager.
...And 7 more matches
nsIMemoryReporterManager
method overview nsisimpleenumerator enumeratemultireporters(); nsisimpleenumerator enumeratereporters(); void init(); void registermultireporter(in nsimemorymultireporter reporter); void registerreporter(in nsimemoryreporter reporter); void unregistermultireporter(in nsimemorymultireporter reporter); void unregisterreporter(in nsimemoryreporter reporter); attributes attribute type description explicit print64 ...
...return value an enumerator of nsimemorymultireporters that are currently registered.
...registermultireporter() requests that memory multi-reporter notifications be sent to the specified objects.
...And 7 more matches
nsIWebContentHandlerRegistrar
inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by @mozilla.org/embeddor.implemented/web-content-handler-registrar;1 as a service: var nsiwchr = cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"] .getservice(ci.nsiwebcontenthandlerregistrar); method overview void registercontenthandler(in domstring mimetype, in domstring uri, in domstring title, in nsidomwindow contentwindow) void registerprotocolhandler(in domstring protocol,in domstring uri, in domstring title, in nsidomwindow contentwindow) methods registercontenthandler summary of registercontenthandler void registercont...
... registerprotocolhandler summary of registerprotocolhandler void registerprotocolhandler( in domstring protocol, in domstring uri, in domstring title, in nsidomwindow contentwindow ); parameters protocol the protocol the site wishes to handle, specified as a string.
...can bypass this by opening about:config and setting preference of gecko.handlerservice.allowregisterfromdifferenthost to true.
...And 7 more matches
Web-based protocol handlers - Web APIs
registering setting up a web application as a protocol handler is not a difficult process.
... basically, the web application uses registerprotocolhandler() to register itself with the browser as a potential handler for a given protocol.
... for example: navigator.registerprotocolhandler("web+burger", "http://www.google.co.uk/?uri=%s", "burger handler"); where the parameters are: the protocol.
...And 7 more matches
tabs - Archive of obsolete content
usage open a tab you can open a new tab, specifying various properties including location: var tabs = require("sdk/tabs"); tabs.open("http://www.example.com"); track tabs you can register event listeners to be notified when tabs open, close, finish loading dom content, or are made active or inactive: var tabs = require("sdk/tabs"); // listen for tab openings.
...ccess individual tabs by index: var tabs = require('sdk/tabs'); tabs.on('ready', function () { console.log('first: ' + tabs[0].title); console.log('last: ' + tabs[tabs.length-1].title); }); you can access the currently active tab: var tabs = require('sdk/tabs'); tabs.on('activate', function () { console.log('active: ' + tabs.activetab.url); }); track a single tab given a tab, you can register event listeners to be notified when the tab is closed, activated or deactivated, or when the page hosted by the tab is loaded or retrieved from the "back-forward cache": var tabs = require("sdk/tabs"); function onopen(tab) { console.log(tab.url + " is open"); tab.on("pageshow", logshow); tab.on("activate", logactivate); tab.on("deactivate", logdeactivate); tab.on("close", logclose); }...
... onopen function a callback function that will be registered for the 'open' event.
...And 6 more matches
widget - Archive of obsolete content
note: if you also register a "click" listener, it will be called instead of the panel being opened.
... on(type, listener) registers an event listener with the widget.
... removelistener(type, listener) unregisters an event listener from the widget.
...And 6 more matches
event/target - Archive of obsolete content
will be auto registered for associated 'message', 'myevent' events on the created instance.
... adding listeners eventtarget interface defines on method, that can be used to register event listeners on them for the given event type: target.on('message', function onmessage(message) { // note: `this` pseudo variable is an event `target` unless // intentionally overridden via `.bind()`.
...}); removing listeners eventtarget interface defines api for unregistering event listeners, via removelistener method: target.removelistener('message', onmessage); emitting events eventtarget interface intentionally does not define an api for emitting events.
...And 6 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
chrome url use a file called a “chrome manifest” to register chrome packages with firefox and start using them.
... to register a package, you use a special uri scheme called a “chrome url” to represent the path to the file.
... extension/ chrome manifest chrome/ #registered in the chrome content package #run with privileges locale package skin package figure 1: chrome packages and chrome registration (fixme: not really explicit and not a figure) cross-package overlays the “overlay” technique introduced in chapter 3 required the use of the xul-overlay instruction in the xul document that is the overlay target.
...And 6 more matches
Modularization techniques - Archive of obsolete content
nscid &aclass, nsifactory **afactory); // creates a class instance for a specific class id static nsresult createinstance(const nscid &aclass, const nsiid &aiid, nsisupports *adelegate, 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, prb...
...ool 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, const char *alibrary); // unload dynamically loaded factories that are not in use static nsresult freelibraries(); }; there are several ways a factory can make its way into the repository.
... the most direct is through registerfactory().
...And 6 more matches
Client-side storage - Learn web development
a service worker is a javascript file that, simply put, is registered against a particular origin (web site, or part of a web site at a certain domain) when it is accessed by a browser.
... when registered, it can control pages available at that origin.
... registering the service worker the first thing to note is that there's an extra bit of code placed in the main javascript file (see index.js).
...And 6 more matches
Getting started with Vue - Learn web development
you can register additional babel plugins in this file.
...this file is often where you register global components or additional vue libraries.
...this object is where you locally register components, define component inputs (props), handle local state, define methods, and more.
...And 6 more matches
mozIPlacesAutoComplete
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void registeropenpage(in nsiuri auri); void unregisteropenpage(in nsiuri auri); constants constant value description match_anywhere 0 match anywhere in each searchable term.
... methods registeropenpage() mark a page as being currently open.
... note: pages will not be automatically unregistered when private browsing mode is entered or exited.
...And 6 more matches
nsIHttpServer
(not supported) * @param function callback optional callback */ listen: function(port, opt, callback) { if (arguments.length == 2 && "function" == typeof opt) { callback = opt; } if (callback) { this.registerprefixhandler("/", callback); } let host = "localhost"; if (typeof port === "string" && port.indexof(':') != -1){ [host, port] = port.split(':'); port = parseint(port); server.identity.add('http', host, port); } server.wrappedjsobject._start(port, host); return true; }, ...
... registerfile: function(path, filepath) { var file = components.classes['@mozilla.org/file/local;1'] .createinstance(components.interfaces.nsilocalfile); file.initwithpath(filepath); return server.registerfile(path, file); }, registerdirectory : function(path, directorypath) { var file = components.classes['@mozilla.org/file/local;1'] .createinstance(components.interfaces.nsilocalfile); file.initwithpath(directorypath); return server.registerdirectory(path, file); }, registerpathhandler: function(path, handlercallback) { server.registerpathhandler(path, function (request, response) { var req = create...
...httprequest(request); var resp = new httpresponse(response); handlercallback(req, resp); }); }, registerprefixhandler: function(prefix, handlercallback) { server.registerprefixhandler(prefix, function (request, response) { var req = createhttprequest(request); var resp = new httpresponse(response); handlercallback(req, resp); }); }, close: function(){ server.stop(function(){}); }, get port() { return server.identity.primaryport } } } reference : mozilla-release/netwerk/test/httpserver/nsihttpserver.idl [scriptable, uuid(cea8812e-faa6-4013-9396-f9936cbb74ec)] in...
...And 6 more matches
nsIProtocolProxyService
e asyncresolve(in nsiuri auri, in unsigned long aflags,in nsiprotocolproxycallback acallback); nsiproxyinfo newproxyinfo(in acstring atype, in autf8string ahost,in long aport, in unsigned long aflags, in unsigned long afailovertimeout, in nsiproxyinfo afailoverproxy); nsiproxyinfo getfailoverforproxy(in nsiproxyinfo aproxyinfo, in nsiuri auri, in nsresult areason); void registerfilter(in nsiprotocolproxyfilter afilter, in unsigned long aposition); void unregisterfilter(in nsiprotocolproxyfilter afilter); constants constant value description resolve_non_blocking 1<<0 this flag may be passed to the resolve method to request that it fail instead of block the calling thread.
... registerfilter() this method may be used to register a proxy filter instance.
... each proxy filter is registered with an associated position that determines the order in which the filters are applied (starting from position 0).
...And 6 more matches
Debugging service workers - Firefox Developer Tools
when you open the application panel’s service workers view on a page that doesn't have a service worker registered, you'll get the following output shown: this gives you some advice on what to do if you don't have a service worker registered, and were perhaps expecting there to be one registered!
... getting your service worker to register before you can look at your service worker in action in the applications panel, you need to successfully register it.
... registration is done with a block of code along these lines, using the register() method: if('serviceworker' in navigator) { navigator.serviceworker .register('sw.js') .then(function() { console.log('service worker registered'); }); } if you get the path wrong, for example, you'll get an error in the web console giving you a hint as to what's wrong, which depends on what exactly is wrong with the code.
...And 6 more matches
event/core - Archive of obsolete content
an event listener may be registered to any event target using the on function: var { on, once, off, emit } = require('sdk/event/core'); var target = { name: 'target' }; on(target, 'message', function listener(event) { console.log('hello ' + event); }); on(target, 'data', console.log); an event of a specific type may be emitted on any event target object using the emit function.
... this will call all registered listeners for the given type on the given event target in the same order they were registered.
... emit(target, 'message', 'event'); // info: 'hello event' emit(target, 'data', { type: 'data' }, 'second arg'); // info: [object object] 'second arg' registered event listeners may be removed using off function: off(target, 'message'); emit(target, 'message', 'bye'); // info: 'hello bye' sometimes listener only cares about first event of specific type.
...And 5 more matches
Install Scripts - Archive of obsolete content
next, we'll want to register the find files in the chrome system so that it can be used with a chrome url.
... this can be done with the registerchrome() function.
... it takes two arguments, the first is the type of chrome to register (content, skin or locale).
...And 5 more matches
Embedding Tips
a service is a singleton object implementing one or more xpcom interfaces and registered with gecko during startup.
... implement the nsiwebprogresslistener interface and register it with the appropriate web browser object via the nsiwebbrowser::addwebbrowserlistener() method.
... implement the nsiuricontentlistener interface, and register it with the appropriate web browser object via the nsiwebbrowser::parenturicontentlistener attribute.
...And 5 more matches
nsIAppShellService
void hidesplashscreen(); obsolete since gecko 1.8 void initialize(in nsicmdlineservice acmdlineservice, in nsisupports nativeappsupportorsplashscreen); obsolete since gecko 1.8 void quit(in pruint32 aferocity); obsolete since gecko 1.8 void registertoplevelwindow(in nsixulwindow awindow); void run(); obsolete since gecko 1.8 void toplevelwindowismodal(in nsixulwindow awindow, in boolean amodal); obsolete since gecko 1.9.1 void unregistertoplevelwindow(in nsixulwindow awindow); note: prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindowinternal.
...nstance(ci.nsiprincipal); docshell.createaboutblankcontentviewer(systemprincipal); var contentwindow = docshell.contentviewer.domdocument.defaultview; // when you are done with it, destroy it if (webnav.close) { webnav.close() }; // only available in firefox 46+, and is needed for good measure webnav = null; // in firefox <= 45 setting to null will cause it to get gc'ed which will destroy it registertoplevelwindow() add a window to the application's registry of windows.
... these windows are generally shown in the windows taskbar, and the application knows it can not quit until it is out of registered windows.
...And 5 more matches
nsIBrowserHistory
ory-service;1"] .getservice(components.interfaces.nsibrowserhistory); method overview void addpagewithdetails(in nsiuri auri, in wstring atitle, in long long alastvisited); obsolete since gecko 15.0 void markpageasfollowedlink(in nsiuri auri); obsolete since gecko 22.0 void markpageastyped(in nsiuri auri); obsolete since gecko 22.0 void registeropenpage(in nsiuri auri); obsolete since gecko 9.0 void removeallpages(); void removepage(in nsiuri auri); void removepages([array, size_is(alength)] in nsiuri auris, in unsigned long alength, in boolean adobatchnotify); void removepagesbytimeframe(in long long abegintime, in long long aendtime); void removepagesfromhost(in autf8string ahost, in bool...
...ean aentiredomain); void removevisitsbytimeframe(in long long abegintime, in long long aendtime); void unregisteropenpage(in nsiuri auri); obsolete since gecko 9.0 note: the markpageasfollowedlink and markpageastyped methods were moved to nsinavhistoryservice in gecko 22.0 so that all markpageas* methods can be found in one interface.
... registeropenpage() obsolete since gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) mark a page as being currently open.
...And 5 more matches
Content Index API - Web APIs
the content index api allows developers to register their offline enabled content with the browser.
...examples could be a news website prefetching the latest articles in the background, or a content streaming app registering downloaded content.
... interfaces contentindex the contentindex interface provides functionality to register content available offline.
...And 5 more matches
ServiceWorkerRegistration - Web APIs
you register a service worker to control one or more pages that share the same origin.
...this must be on the same origin as the document that registers the serviceworker.
...an active worker will control a serviceworkerclient if the client's url falls within the scope of the registration (the scope option set when serviceworkercontainer.register is first called.) serviceworkerregistration.navigationpreload read only returns the instance of navigationpreloadmanager associated with the current service worker registration.
...And 5 more matches
Preferences - Archive of obsolete content
they will be copied and registered with the preferences system automatically.
... here is a straightforward example: var myprefobserver = { register: function() { // first we'll need the preference services to look for preferences.
... this.branch.addobserver("", this, false); }, unregister: function() { this.branch.removeobserver("", this); }, observe: function(asubject, atopic, adata) { // asubject is the nsiprefbranch we're observing (after appropriate qi) // adata is the name of the pref that's been changed (relative to asubject) switch (adata) { case "pref1": // extensions.myextension.pref1 was changed break; case "pref2": ...
...And 4 more matches
Observer Notifications - Archive of obsolete content
observerservice.removeobserver(testobserver, "xulschoolhello-test-topic"); after you have registered some observers to listen to a notification topic, you can then use the notifyobservers method to send a notification to all of them.
... /** * notifies all the registered observers with the test notification topic.
... createinstance(components.interfaces.nsisupportsstring); // assign some text to data attribute subject.data = "this is a test."; // notify all registered observers observerservice.notifyobservers( subject, "xulschoolhello-test-topic", "hello"); } in the notifytest method, the notifyobservers call is used to notify all registered observers about the notification topic "xulschoolhello-test-topic".
...And 4 more matches
XPCOM Objects - Archive of obsolete content
void addobserver(in string adomain, in nsiobserver aobserver, in boolean aholdweak); luckily, you don't have to do anything special if you want to register your js object as a preference observer.
...the purpose of this code is to register the component so that you can get references to it just like all other firefox components.
... var countermodule = { // registerself, unregisterself, getclassobject, canunload }; the only thing you may need to change here is when you need to use the category manager.
...And 4 more matches
Using the Stylesheet Service - Archive of obsolete content
the stylesheets registered with this api apply to all documents; firefox 18 extended nsidomwindowutils with loadadditionalstylesheet() and removeadditionalstylesheet() to manage stylesheets for a specific document (bug 737003).
... adding a stylesheet to use the stylesheet service, you get a reference to the service, create a uri and pass the uri to the stylesheet service's loadandregistersheet method.
... var sss = components.classes["@mozilla.org/content/style-sheet-service;1"] .getservice(components.interfaces.nsistylesheetservice); var ios = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ios.newuri("chrome://myext/content/myext.css", null, null); sss.loadandregistersheet(uri, sss.user_sheet); note: loadandregistersheet will load the stylesheet synchronously, so you should only call this method using local uris.
...And 4 more matches
Building accessible custom components in XUL - Archive of obsolete content
this is handled in the spreadsheet_focus function, which is registered as a handler for the focus event.
...you can register event handlers on specific xul elements, and when an event occurs, it bubbles down the element hierarchy and back up.
... you can capture events on the way down or on the way up, and registered event handlers get an event object which has all the properties you would expect for that event.
...And 4 more matches
Monitoring plugins - Archive of obsolete content
this component then reports the plugin runtime using the observer service to anyone registered to receive the notifications.
... usage to make use of the new component you must register to receive its runtime notifications using the observer service.
... below are a number of javascript snippets that would be useful to developers trying to use this feature: registration to register for runtime notifications with the observer service you must create a class with an observe method which receives 3 parameters (subject, topic and data) as well as a register method that contains the following code: var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice (components.interfaces.nsiobserverservice); observerservice.addobserver(this, "experimental...
...And 4 more matches
Plug-in Development Overview - Gecko Plugin API Reference
decide the mime type for the plug-in (see registering plug-ins).
... registering plug-ins gecko identifies a plug-in by the mime type it supports.
... the server looks for the mime type registered by a plug-in, based on the file extension, and starts sending the file to the browser.
...And 4 more matches
AddonManager
installaddonsfromwebpage() starts installation of an array of addoninstall notifying the registered web install listener of blocked or started installs.
...bpage( in string mimetype, in nsidomwindow source, in nsiuri uri, in addoninstall installs[] ) parameters mimetype the mimetype of add-ons being installed source the nsidomwindow that started the installs uri the nsiuri that started the installs installs the array of addoninstalls to be installed addinstalllistener() adds a new installlistener if the listener is not already registered.
... void addinstalllistener( in installlistener listener ) parameters listener the installlistener to add removeinstalllistener() removes an installlistener if the listener is registered.
...And 4 more matches
Receiving startup notifications
the important thing to note is that now instead of registering with the category manager programmatically as was done in the past, you add lines to your chrome.manifest to let the application handle it for you.
...the startup process during application startup, the application's manifest is used to get a list of the components it needs to register, and those components are loaded.
...receiving startup notifications prior to gecko 2.0 (firefox 4) to receive startup notifications, one needs to register with the "app-startup" category using nsicategorymanager; having done so, the component will receive these startup notifications, including: xpcom-startup sent when xpcom finishes starting up.
...And 4 more matches
nsIDirectoryService
inherits from: nsisupports last changed in gecko 1.7 method overview void init(); void registerprovider(in nsidirectoryserviceprovider prov); void unregisterprovider(in nsidirectoryserviceprovider prov); init() initializes the nsidirectoryservice instance.
...registerprovider() register a provider with the service.
... the directory service will keep a strong reference to the nsidirectoryserviceprovider instances registered via registerprovider.
...And 4 more matches
nsIJetpack
*/); void registerreceiver(in astring amessagename, in jsval areceiver); void unregisterreceiver(in astring amessagename, in jsval areceiver); void unregisterreceivers(in astring amessagename); void evalscript(in astring ascript); nsivariant createhandle(); void destroy(); methods sendmessage() this method asynchronously sends a message to the jetpack process.
... registerreceiver() this registers a callback to be triggered whenever the jetpack process sends a particular message.
... note: multiple callbacks may be registered for the same message; they will all be triggered.
...And 4 more matches
nsIObserver
inherits from: nsisupports last changed in gecko 0.9.6 method overview void observe(in nsisupports asubject, in string atopic, in wstring adata); methods observe() this method will be called when there is a notification for the topic that the observer has been registered for.
... remarks the specific values and meanings of the parameters provided varies widely, though, according to where the observer was registered, and what topic is being observed.
... example the following code is an implementation of nsiobserver that is registered to receive notifications for the "mytopicid" topic.
...And 4 more matches
Using nsIDirectoryService
you can directly add a new nsifile with any property string using the nsiproperties interface: components.classes["@mozilla.org/file/directory_service;1"] .getservice(components.interfaces.nsiproperties) .set("myfilename", file); now, if your cost is too high to set all of these properties at once, you can register to be a callback that can provide an nsifile.
...apart from this interface there is a function, registerprovider which will allow you to register a nsidirectoryserviceprovider, which implements the getfile callback function: var provider = { getfile : function(prop, persistant) { // return an nsifile }, } components.classes["@mozilla.org/file/directory_service;1"] .getservice(components.interfaces.nsidirectoryservice).registerprovider(provider); when the callback is called, it will be passed the string key, and should return an nsifile.
...in order to change these locations using nsifilelocator and still be able to use the same components directory as an existing mozilla installation, you had to make a component with the same id as nsifilelocator and then, after auto-registering components, manually register your own and replace the existing one -- all in all, a big pain.
...And 4 more matches
Plug-in Development Overview - Plugins
decide the mime type for the plug-in (see registering plug-ins).
... registering plug-ins gecko identifies a plug-in by the mime type it supports.
... the server looks for the mime type registered by a plug-in, based on the file extension, and starts sending the file to the browser.
...And 4 more matches
ContentIndex - Web APIs
the contentindex interface of the content index api allows developers to register their offline enabled content with the browser.
... methods contentindex.add registers an item with the content index.
... contentindex.delete unregisters an item from the currently indexed content.
...And 4 more matches
ServiceWorkerContainer - Web APIs
the serviceworkercontainer interface of the service worker api provides an object representing the service worker as an overall unit in the network ecosystem, including facilities to register, unregister and update service workers, and access the state of service workers and their registrations.
... most importantly, it exposes the serviceworkercontainer.register() method used to register service workers, and the serviceworkercontainer.controller property used to determine whether or not the current page is actively controlled.
... methods serviceworkercontainer.register() creates or updates a serviceworkerregistration for the given scripturl.
...And 4 more matches
Variable fonts guide - CSS: Cascading Style Sheets
as defined in the specification, there are two kinds of axes: registered and custom: registered axes are simply those that are most frequently encountered, and common enough that the authors of the specification felt it was worth standardizing.
... the five currently registered axes are weight, width, slant, italic, and optical size.
... registered axes and existing css attributes in this section we'll demonstrate the five registered axes defined with examples and the corresponding css.
...And 4 more matches
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
it has thus been necessary to solve all of the issues involved in creating and registering xpcom components, building jar files and manifests, installing the lot into the firefox extensions/ directory and so forth.
...the final file, myextension.cpp, contains the code necessary to register these components, as described in the next section.
... registering your components this article explains how to register xpcom components in gecko 2.0 and later.
...And 3 more matches
Creating XPI Installer Modules - Archive of obsolete content
mozilla is alerted to these content specifications and the resources they manage either through registration as part of an installation process (as described in this tutorial) or by way of a shortcut file called installed-chrome.txt, in which developers can point at their new contents.rdf files and have them registered as they develop (a process we do not describe here).
... one way of another, the chrome registry is shown the contents.rdf files; the contents.rdf files in turn point to new resources, and the resources are then registered with mozilla and accessible to the user.
...for this option to work, the designated chrome must have been installed and registered properly with mozilla.
...And 3 more matches
XPJS Components Proposal - Archive of obsolete content
xpconnect provides the mechanisms for communication between native and js xpcom components, but it does not provide all of the infrastructure to register and instantiate js components outside of the limitations of the browser window.
...just as with native component modules each of these .js files will be expected to have the functions: nsregisterself nsgetfactory nsunregisterself (optional) nscanunload (optional) each .js file might implement one or more components.
...the xpjsmanager is in charge of loading these .js files, helping them register themselves, and acting as an intermediary between the xpcom component manager and the js code.
...And 3 more matches
XUL Event Propagation - Archive of obsolete content
when you register an event listener on an ancestor of the event target (i.e.
...in another example, an onload event handler for a xul window can register a box element to capture all the click events that are raised from its child elements: var bbox = document.getelementbyid("bigbox"); if (bbox) bbox.addeventlistener("click", function() { alert('captured'); }, true); ...
...any xul element may use the dom addeventlistener method to register itself to capture events.
...And 3 more matches
CommandLine - Archive of obsolete content
a similar and better way to implement this solution is by defining argument specific handlers with registering and unregistering functions in your command line handler service.
...eryinterface : function mod_qi(aiid) { if (aiid.equals(nsimodule) || aiid.equals(nsisupports)) return this; throw components.results.ns_error_no_interface; }, /* nsimodule */ getclassobject : function mod_gch(acompmgr, acid, aiid) { if (acid.equals(class_id)) return apphandler.queryinterface(aiid); throw components.results.ns_error_failure; }, registerself : function mod_regself(acompmgr, afilespec, alocation, atype) { var compreg = acompmgr.queryinterface(nsicomponentregistrar); compreg.registerfactorylocation(class_id, class_name, contract_id, afilespec, alocation, atype); var catman = components.classes["@mozilla.org/categorymanager;1"] .getservice(nsicategorymana...
...ger); catman.addcategoryentry("command-line-handler", cld_category, contract_id, true, true); }, unregisterself : function mod_unreg(acompmgr, alocation, atype) { var compreg = acompmgr.queryinterface(nsicomponentregistrar); compreg.unregisterfactorylocation(class_id, alocation); var catman = components.classes["@mozilla.org/categorymanager;1"] .getservice(nsicategorymanager); catman.deletecategoryentry("command-line-handler", cld_category); }, canunload : function (acompmgr) { return true; } }; function nsgetmodule(acompmgr, afilespec) { return apphandlermodule; } create an observer that will get notified when arguments change: chrome/content/cmdline.js function commandlineobserver() { this.reg...
...And 3 more matches
Visual typescript game engine - Game development
i use html request only for loading local/staged html (like register, login etc.).
...for main account session staff like login, register etc.
... */ private appusebroadcaster: boolean = false; /** * possible variant by default : * "register", "login" */ private startuphtmlform: string = "register"; private gamelist: any[]; /** * implement default gameplay variable's */ private defaultgameplaylevelname: string = "level1"; private autostartgameplay: boolean = true; start the dependency system from app.ts the first game template is platformer.
...And 3 more matches
mach
instead, they are registered with mach.
...it's a python script that creates an instance of the mach core, registers commands with it, then tells the mach core to execute.
...implementing new commands is as simple as writing a few lines of python and registering the created file with mach.
...And 3 more matches
Performance
key points to keep in mind scripts registered during addon startup get executed during session restore.
...ize()}) } // processmodule.jsm const exported_symbols = ['getmaincopy']; var maincopy; services.cpmm.addmessagelistener("my-addon:update-configuration", function(message) { maincopy = message.data.newconfig; }) funtion getmaincopy() { return maincopy; } // framescript.js components.utils.import("resource://my-addon/processmodule.jsm") // getmaincopy() used by other functions don't register observers (and other callbacks to global services) in a frame script bad: //framescript.js services.obs.addobserver("document-element-inserted", { observe: function(doc, topic, data) { if(doc.ownerglobal.top != content) return; // bail out if this is for another tab decoratedocument(doc); } }) observer notifications get fired for events that happen anywhere in the browse...
...if each framescript registers a seperate listener then the observed action will trigger the callbacks in all tabs.
...And 3 more matches
HTTP delegation
instead of improving the simple http client in nss, the nss team has decided to provide an nss api to register application callback functions.
... if provided by the application, nss will use the registered http client for querying an oscp responder.
...look for function sec_registerdefaulthttpclient and all functions having names that start with sec_http.
...And 3 more matches
HTTP delegation
instead of improving the simple http client in nss, the nss team has decided to provide an nss api to register application callback functions.
... if provided by the application, nss will use the registered http client for querying an oscp responder.
...look for function sec_registerdefaulthttpclient and all functions having names that start with sec_http.
...And 3 more matches
Tracing JIT
nanojit/regalloc.* nanojit's register allocator.
... this is a local register allocator, meaning that it does not allocate registers across basic blocks.
... it is correspondingly very simple: register allocation is done immediately, step-by-step as code is being generated.
...And 3 more matches
mozIStorageConnection
removeprogresshandler() removes the progress handler that was registered with mozistorageconnection.registerprogresshandler().
... return value returns the previous registered handler.
...only one handler can be registered at a time, so if you need more than one, you will have to chain them.
...And 3 more matches
nsIModule
inherits from: nsisupports last changed in gecko 0.9.9 method overview boolean canunload(in nsicomponentmanager acompmgr); void getclassobject(in nsicomponentmanager acompmgr, in nscidref aclass, in nsiidref aiid, [retval, iid_is(aiid)] out nsqiresult aresult); void registerself(in nsicomponentmanager acompmgr, in nsifile alocation, in string aloaderstr, in string atype); void unregisterself(in nsicomponentmanager acompmgr, in nsifile alocation, in string aloaderstr); methods canunload() this method may be queried to determine whether or not the component module can be unloaded by xpcom.
... exceptions thrown ns_error_factory_not_registered indicates that the requested class is not available.
... registerself() when the nsimodule is discovered, this method will be called so that any setup registration can be preformed.
...And 3 more matches
Component; nsIPrefBranch
for example, if your observer is registered with addobserver("bar.", ...) on a branch with root "foo.", modifying the preference "foo.bar.baz" will trigger the observer, and adata parameter will be "bar.baz".
... aobserver an observer previously registered with addobserver.
... remarks registering as a preference observer can open an object to potential cyclical references which will cause memory leaks.
...And 3 more matches
nsIPrefBranch2
for example, if your observer is registered with addobserver("bar.", ...) on a branch with root "foo.", modifying the preference "foo.bar.baz" will trigger the observer, and adata parameter will be "bar.baz".
... aobserver an observer previously registered with addobserver.
... remarks registering as a preference observer can open an object to potential cyclical references which will cause memory leaks.
...And 3 more matches
nsIStyleSheetService
to create an instance, use: var stylesheetservice = components.classes["@mozilla.org/content/style-sheet-service;1"] .getservice(components.interfaces.nsistylesheetservice); method overview void loadandregistersheet(in nsiuri sheeturi, in unsigned long type); boolean sheetregistered(in nsiuri sheeturi, in unsigned long type); void unregistersheet(in nsiuri sheeturi, in unsigned long type); constants constant value description agent_sheet 0 user_sheet 1 author_sh...
...eet 2 methods loadandregistersheet() synchronously loads a style sheet from sheeturi and adds it to the list of user or agent style sheets.
...void loadandregistersheet( in nsiuri sheeturi, in unsigned long type ); parameters sheeturi uri of the stylesheet to load and register.
...And 3 more matches
nsITelemetry
d clearscalars(); test only void flushbatchedchildtelemetry(); void recordevent(in acstring acategory, in acstring amethod, in acstring aobject, [optional] in jsval avalue, [optional] in jsval extra); void seteventrecordingenabled(in acstring acategory, in boolean aenabled); jsval snapshotevents(in uint32_t adataset, [optional] in boolean aclear); void registerevents(in acstring acategory, in jsval aeventdata); void registerscalars(in acstring acategoryname, in jsval ascalardata); void clearevents(); test only attributes attribute type description canrecordbase boolean a flag indicating if telemetry can record base data (fhr data).
... histogramsnapshots jsval an object containing a snapshot from all of the currently registered histograms.
... methods gethistogrambyid() get an histogram by id for histograms registered in histograms.json.
...And 3 more matches
nsITextInputProcessor
if the key attribute value is not a registered key name, this flag causes throwing an exception.
... therefore, this can prevent non-printable key events to cause dispatching as printable keyboard events and you can detect the registered key name change from the thrown exception.
...when you attempt to dispatch a printable key's event whose key attribute value (i.e., inputting string) will match with a registered key name, this flag makes dispatched keyboard events printable keyboard events forcibly.
...And 3 more matches
nsIWindowWatcher
authprompter(in nsidomwindow aparent); nsiprompt getnewprompter(in nsidomwindow aparent); nsidomwindow getwindowbyname(in wstring atargetname, in nsidomwindow acurrentwindow); nsisimpleenumerator getwindowenumerator(); nsidomwindow openwindow(in nsidomwindow aparent, in string aurl, in string aname, in string afeatures, in nsisupports aarguments); void registernotification(in nsiobserver aobserver); void setwindowcreator(in nsiwindowcreator creator); void unregisternotification(in nsiobserver aobserver); attributes attribute type description activewindow nsidomwindow the watcher serves as a global storage facility for the current active (front most non-floating-palette-type) window, storing and ret...
... registernotification() clients of this service can register themselves to be notified when a window is opened or closed (added to or removed from this service).
... void registernotification( in nsiobserver aobserver ); parameters note: be careful about generating open/close window events inside nsiobserver.observe().
...And 3 more matches
Address Book examples
load and save listeners edit dialogs for both contacts and mailing lists expose functions for registering load and save listeners.
... for example, in order to register a load listener for a contact, the following should take place within the scope of the contact editor dialog: /* an example load listener for a contact * acard the nsiabcard being loaded * adocument a reference to the contact editor document */ function foo(acard, adocument) { // do something useful, like disabling // input fields that cards for this // address book type do not support.
... } registerloadlistener(foo); save listeners are functions that take the same parameters, and can be registered with: registersavelistener(foo); load and save listeners can be unregistered using unregisterloadlistener(foo) and unregistersavelistener(foo), respectively.
...And 3 more matches
about:debugging (before Firefox 68) - Firefox Developer Tools
workers the workers page shows your workers, categorised as follows: all registered service workers all registered shared workers other workers, including chrome workers and dedicated workers you can connect the developer tools to each worker, and send push notifications to service workers.
...three states are distinguished: "registering": this covers all states between the service worker's initial registration, and its assuming control of pages.
...you can set breakpoints, step through code, watch variables, evaluate code, and so on: registering workers at first, you won't see any workers listed under service workers or shared workers.
...And 3 more matches
EventTarget.removeEventListener() - Web APIs
the eventtarget.removeeventlistener() method removes from the eventtarget an event listener previously registered with eventtarget.addeventlistener().
... the available options are: capture: a boolean which indicates that events of this type will be dispatched to the registered listener before being dispatched to any eventtarget beneath it in the dom tree.
... usecapture optional specifies whether the eventlistener to be removed is registered as a capturing listener or not.
...And 3 more matches
Using the Frame Timing API - Web APIs
an application can register a performanceobserver for "frame" performance entry types and the observer will have data about the duration of each frame event.
... frame observers the performance observer interfaces allow an application to register an observer for specific performance event types.
... function create_frame_observer() { if (window.performanceobserver === undefined) return; // register the performance observer var observe_frame = new performanceobserver(function(list) { // log the frame entries var perfentries = list.getentriesbytype("frame"); for (var i=0; i < perfentries.length; i++) { console.log("obs #1: [" + i + "] = " + perfentries[i].name); } }); // only observe 'frame' events observe_frame.observe({entrytypes: ['frame']}); } function init ...
...And 3 more matches
Web Authentication API - Web APIs
web authentication concepts and usage the web authentication api (also referred to as webauthn) uses asymmetric (public-key) cryptography instead of passwords or sms texts for registering, authenticating, and second-factor authentication with websites.
... many websites already have pages that allow users to register new accounts or sign in to an existing account, and the web authentication api acts as a replacement or supplement to those on those existing webpages.
... similar to the other forms of the credential management api, the web authentication api has two basic methods that correspond to register and login: navigator.credentials.create() - when used with the publickey option, creates new credentials, either for registering a new account or for associating a new asymmetric key pair credentials with an existing account.
...And 3 more matches
Using XMLHttpRequest - Web APIs
urlencoded or text/plain or method is get */ ffilter(ofield.name) + "=" + ffilter(ofield.value) ); } } processstatus(this); } return function (oformelement) { if (!oformelement.action) { return; } new submitrequest(oformelement); }; })(); </script> </head> <body> <h1>sending forms with pure ajax</h1> <h2>using the get method</h2> <form action="register.php" method="get" onsubmit="ajaxsubmit(this); return false;"> <fieldset> <legend>registration example</legend> <p> first name: <input type="text" name="firstname" /><br /> last name: <input type="text" name="lastname" /> </p> <p> <input type="submit" value="submit" /> </p> </fieldset> </form> <h2>using the post method</h2> <h3>enctype: application/x-www-...
...form-urlencoded (default)</h3> <form action="register.php" method="post" onsubmit="ajaxsubmit(this); return false;"> <fieldset> <legend>registration example</legend> <p> first name: <input type="text" name="firstname" /><br /> last name: <input type="text" name="lastname" /> </p> <p> <input type="submit" value="submit" /> </p> </fieldset> </form> <h3>enctype: text/plain</h3> <form action="register.php" method="post" enctype="text/plain" onsubmit="ajaxsubmit(this); return false;"> <fieldset> <legend>registration example</legend> <p> your name: <input type="text" name="user" /> </p> <p> your message:<br /> <textarea name="message" cols="40" rows="8"></textarea> </p> <p> <input type="submit" value="subm...
...it" /> </p> </fieldset> </form> <h3>enctype: multipart/form-data</h3> <form action="register.php" method="post" enctype="multipart/form-data" onsubmit="ajaxsubmit(this); return false;"> <fieldset> <legend>upload example</legend> <p> first name: <input type="text" name="firstname" /><br /> last name: <input type="text" name="lastname" /><br /> sex: <input id="sex_male" type="radio" name="sex" value="male" /> <label for="sex_male">male</label> <input id="sex_female" type="radio" name="sex" value="female" /> <label for="sex_female">female</label><br /> password: <input type="password" name="secret" /><br /> what do you prefer: <select name="image_type"> <option>books</option> <option>cinema</option> ...
...And 3 more matches
ui/sidebar - Archive of obsolete content
on(type, listener) registers an event listener with the sidebar.
... once(type, listener) registers an event listener with the sidebar.
... removelistener(type, listener) unregisters/removes an event listener from the sidebar.
...And 2 more matches
Enhanced Extension Installation - Archive of obsolete content
there is no clean uninstall procedure, as the -install-global-extension flag was designed only as a means to install items for all user profiles, not as a means for third party installers to register their components.
... since all metadata is now stored in the profile directory, there is no longer any need for special extension system handling of the -register command line flag, so support for that has been removed.
...code in the extension system can quickly locate an install location for an item using the getinstalllocation method which basically reads this value from the datasource and retrieves the install location from the hash of registered install locations.
...And 2 more matches
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
it keeps track of currently pending loads and registered content listeners.
...request-innards"> <area alt="(7) onstartrequest()" coords="639,129,703,129,703,165,833,165,833,204,639,204" href="#onstartrequest" shape="poly"> <area alt="(6) asyncopen()" coords="637,121,709,121,709,96,783,96,783,58,637,58" href="#asyncopen" shape="poly"> <area alt="(5) open()" coords="311,306,432,371" href="#open"> <area alt="(4)" coords="90,384,127,417" href="#openuri-innards"> <area alt="(0) registercontentlistener()" coords="37,474,346,474,346,505,88,505,88,535,37,535" href="#registercontentlistener" shape="poly"> <area alt="(3) openuri() (nsuriloader)" coords="5,207,312,269" href="#openuri"> <area alt="(2)" coords="102,114,139,148" href="#internalload"> <area alt="(1) loaduri/onlinkclick" coords="77,5,449,59" href="#loaduri"> <area alt="nsiexternalhelperappservice" coords="527,305,839,339" ...
... guided tour during startup and component initialization, components register themselves with the uriloader via registercontentlistener.
...And 2 more matches
XULRunner 2.0 Release Notes - Archive of obsolete content
to register xulrunner with the system, open a command prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only).
...register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only).
...register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only).
...And 2 more matches
Common causes of memory leaks in extensions - Extensions
forgetting to unregister observers holding onto event observers for too long is another problem.
... in overlay code you may use an unload event listener: addeventlistener("unload", function() { services.obs.removeobserver(myobserver, "private-browsing"); }, false); in bootstrap.js (restartless add-ons) unregister your observer in your shutdown function: function shutdown() { // ...
... services.obs.removeobserver(myobserver, "private-browsing"); } in javascript code modules it recommended to also observe the xpcom-shutdown or quit-application notifications and unregister your observers from that topic: var myobserver = { observe: function(subject, topic, data) { if (topic == "xpcom-shutdown") { services.obs.removeobserver(myobserver, "private-browsing"); services.obs.removeobserver(myobserver, "xpcom-shutdown"); } else { // do something with "private-browsing" } } }; services.obs.addobserver(myobserver, "private-browsing", false); services.obs.addobserver(myobserver, "xpcom-shutdown", false); finally, a lot of services other than nsiobserverservice accept nsiobserver parameters or other interfaces and will keep strong references arou...
...And 2 more matches
Creating our first Vue component - Learn web development
at the top of your <script> tag, add the following to import your todoitem component: import todoitem from './components/todoitem.vue'; inside your component object, add the components property, and inside it add your todoitem component to register it.
... your <script> contents should now look like this: import todoitem from './components/todoitem.vue'; export default { name: 'app', components: { todoitem } }; this is the same way that the helloworld component was registered by the vue cli earlier.
... registering props in vue, there are two ways to register props: the first way is to just list props out as an array of strings.
...And 2 more matches
Browser chrome tests
cleaning up after yourself if you need to do special clean up after running your test, you can register a cleanup function that is guaranteed to be run after your test finishes.
... you can call registercleanupfunction() at any point in your test, even in head.js if you need to register a clean up function for all tests in that folder.
... notice that you can register as many clean up functions as you will.
...And 2 more matches
Command line options
"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.
... --register-user registers xulrunner for a single user.
... --unregister-global unregisters xulrunner for all users.
...And 2 more matches
Limitations of frame scripts
for example: nsinavhistoryservice nsinavbookmarksservice observers in the content process as noted in observers in the chrome process, most observers should be registered in the chrome process and will not work in the content process.
... the exceptions are: content-document-global-created document-element-inserted outer-window-destroyed inner-window-destroyed dom-window-destroyed these must be registered in the content process.
... nsiaboutmodule by default, custom about: pages registered using nsiaboutmodule are loaded in the chrome process.
...And 2 more matches
Getting Started with Chat
nickserv this bot allows you to register your nickname which prevents other users from using it.
... nickserv also automatically elevates all registered users to operators when they sign on.the following are some helpful commands which can be used by nickserv: /msg nickserv register password email this registers your nickname with the server.
... /msg nickserv identify password once registered, you need to type this every time you want to sign into channels using your registered nickname /msg nickserv help this displays a list of commands which can be used with nickserv /msg nickserv help register this displays helpful information about nickname registration /msg nickserv help identify this displays helpful information about identifying yourself upon sign in for more information about nickserv go here.
...And 2 more matches
Promise
you can also call the then method multiple times on the same promise, and the callbacks will be invoked in the same order as they were registered.
...you can register a rejection callback on the returned promise instead (using catch() or then()), to process any exception occurred in either of the callbacks registered on this promise.
... note: when you call the then method multiple times on the same promise, the registered callbacks are always executed independently.
...And 2 more matches
XPCOMUtils.jsm
}, // [optional] an array of categories to register this component in.
...] // if this is defined, the component is registered in this // category only on the specified applications.
...}; note: the ability to register the component in a category only on specific applications by adding the apps field to a category entry was added in gecko 2.
...And 2 more matches
Mozilla DOM Hacking Guide
static nsresult registerclassname(print32 adomclassinfoid): help me!
... static nsresult registerclassprotos(print32 adomclassinfoid): help me!
... static nsresult registerexternalclasses();: help me!
...And 2 more matches
An overview of NSS Internals
a third file contains the list of external pkcs#11 modules that have been registered to be used by nss.
... if a programmer wants to influence how nss verifies certificates or how nss verifies the data presented in a ssl connection handshake, it is possible to register application-defined callback functions which will be called by nss at the appropriate point of time, and which can be used to override the decisions made by nss.
...if you must support proxies in your application, you are able to register your own implementation of an http request callback interface, and nss can use your application code that supports proxies.
...And 2 more matches
Index
a third file contains the list of external pkcs#11 modules that have been registered to be used by nss.
... if a programmer wants to influence how nss verifies certificates or how nss verifies the data presented in a ssl connection handshake, it is possible to register application-defined callback functions which will be called by nss at the appropriate point of time, and which can be used to override the decisions made by nss.
...if you must support proxies in your application, you are able to register your own implementation of an http request callback interface, and nss can use your application code that supports proxies.
...And 2 more matches
Creating a Python XPCOM component
registering the interface in the "components" directory, execute : ../xpidl -m typelib -w -v -i /usr/share/idl/mozilla/ nsipysimple.idl on windows you must point to the idl directory as part of your mozilla build.
... def __del__(self): if verbose: print "pysimple: __del__ method called - object is destructing" def write(self): print self.yourname def change(self, newname): self.yourname = newname then register your component; the procedure is the same for any component, but will not work if python components weren't enabled.
... to register the component, touch the .autoreg (a hidden file) in the bin directory, or delete xpti.dat.
...And 2 more matches
Packaging WebLock
the installation script for the weblock component can also be used to register the component with the browser into which it is installed (see registration methods in xpcom for more information on registration).
... the next section shows how this process of downloading, copying and registering the necessary files from the xpi can be achieved with an xpinstall installation script.
...once triggered (see the weblock trigger script), the installation script: downloads the weblock component and places it in the components directory copies the weblock subdirectory in the mozilla chrome application subdirectory registers both the component and the ui the xpinstall api provides such essential methods[essential-methods] as initinstall, registerchrome, addfile, and others.
...And 2 more matches
nsIComponentManager
exceptions thrown ns_error_factory_not_registered indicates that the specified class is not registered.
... exceptions thrown ns_error_factory_not_registered indicates that the specified class is not registered.
... exceptions thrown ns_error_factory_not_registered indicates that the specified class is not registered.
...And 2 more matches
nsIConsoleService
rvice); method overview void getmessagearray([array, size_is(count)] out nsiconsolemessage messages, out uint32_t count);obsolete since gecko 19 void getmessagearray([optional] out uint32_t count, [retval, array, size_is(count)] out nsiconsolemessage messages); void logmessage(in nsiconsolemessage message); void logstringmessage(in wstring message); void registerlistener(in nsiconsolelistener listener); void reset(); void unregisterlistener(in nsiconsolelistener listener); methods getmessagearray() to obtain an array of all logged messages.
... registerlistener() registers a listener, to notify when an error is logged.
... void registerlistener( in nsiconsolelistener listener ); parameters listener the nsiconsolelistener to add.
...And 2 more matches
nsIUpdateTimerManager
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void registertimer(in astring id, in nsitimercallback callback, in unsigned long interval); methods registertimer() presents a user interface that checks for and displays the available updates.
... void registertimer( in astring id, in nsitimercallback callback, in unsigned long interval ); parameters id an id used to identify the timer interval; used for persistence.
... in order to avoid having to instantiate a component to call the registertimer() method, the component can instead register an update-timer category with comma-separated values as a single string representing the timer, like this: _xpcom_categories: [{ category: "update-timer", value: "contractid," + "method," + "id," + "preference," + "interval" }], this allows you to schedule the tim...
...And 2 more matches
nsIWebBrowser
embedders use this interface during initialization to associate the new web browser instance with the embedders chrome and to register any listeners.
... the chrome object may optionally implement nsiwebprogresslistener instead of explicitly calling addwebbrowserlistener() and removewebbrowserlistener() to register a progress listener object.
... methods addwebbrowserlistener() registers a listener of the type specified by the iid to receive callbacks.
...And 2 more matches
nsIWebProgress
methods addprogresslistener() registers a listener to receive web progress events.
...ns_error_failure indicates that alistener was already registered.
... removeprogresslistener() removes a previously registered listener of progress events.
...And 2 more matches
PushRegistrationManager - Web APIs
returns an interface to register or unregister a push registration, get an active registration, or check the permission status of the registration.
... methods pushregistrationmanager.register() returns a promise that resolves to a pushregistration with details of a new registration.
... pushregistrationmanager.unregister() returns a promise that resolves to a pushregistration with details of the unregistered registration.
...And 2 more matches
Background audio processing using AudioWorklet - Web APIs
with the processor registered, you can create a new audioworkletnode which passes the audio through the processor's code when the node is linked into the chain of audio nodes along with any other audio nodes.
... the module installs the new audio worklet processor class by calling registerprocessor(), specifying a name for the audio processor and the class that defines the processor.
... a single audio worklet processor module may define multiple processor classes, registering each of them with individual calls to registerprocessor().
...And 2 more matches
font-variation-settings - CSS: Cascading Style Sheets
registered and custom axes variable font axes come in two types: registered and custom.
... registered axes are the most commonly encountered — common enough that the authors of the specification felt they were worth standardizing.
... here are the registered axes along with their corresponding css properties: axis tag css property "wght" font-weight "wdth" font-stretch "slnt" (slant) font-style: oblique + angle "ital" font-style: italic "opsz" font-optical-sizing custom axes can be anything the font designer wants to vary in their font, for example ascender or descender heights, the size of serifs, or anything else they can imagine.
...And 2 more matches
DOM onevent handlers - Developer guides
registering onevent handlers the onevent handlers are properties on certain dom elements to manage how that element reacts to events.
...for example, for the progress event on instances of xmlhttprequest: const xhr = new xmlhttprequest(); xhr.onprogress = function() { … }; html onevent attributes html elements have attributes named onevent which can be used to register a handler for an event directly within the html code.
... when the event handler is invoked, the this keyword inside the handler is set to the dom element on which the handler is registered.
...And 2 more matches
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
let's explore all of these index.js the index.js file starts by registering the service worker: navigator.serviceworker.register('service-worker.js') .then(function(registration) { return registration.pushmanager.getsubscription() .then(async function(subscription) { // registration part }); }) .then(function(subscription) { // subscription part }); it is a little bit more complicated than the service worker we saw in the js13kpwa demo.
... in this particular case, after registering, we use the registration object to subscribe, and then use the resulting subscription object to complete the whole process.
... fetch('./register', { method: 'post', headers: { 'content-type': 'application/json' }, body: json.stringify({ subscription: subscription }), }); then the globaleventhandlers.onclick function on the subscribe button is defined: document.getelementbyid('doit').onclick = function() { const payload = document.getelementbyid('notification-payload').value; const delay = docu...
...And 2 more matches
page-worker - Archive of obsolete content
on(type, listener) registers an event listener with the page worker.
... removelistener(type, listener) unregisters an event listener from the page worker.
... parameters type : string the type of event for which listener was registered.
... listener : function the listener function that was registered.
panel - Archive of obsolete content
on(type, listener) registers an event listener with the panel.
... removelistener(type, listener) unregisters an event listener from the panel.
... parameters type : string the type of event for which listener was registered.
... listener : function the listener function that was registered.
frame/hidden-frame - Archive of obsolete content
add registers a hidden frame, preparing it to load content.
... remove unregisters a frame, unloading any content that was loaded in it.
... functions add(hiddenframe) register a hidden frame, preparing it to load content.
... parameters hiddenframe : hiddenframe the frame to add remove(hiddenframe) unregister a hidden frame, unloading any content that was loaded in it.
Custom about: URLs - Archive of obsolete content
this page describes how to register a new about: url for your extension.
... // greater than or equal to firefox48 so asecurity_or_aloadinfo is aloadinfo channel = services.io.newchannelfromuriwithloadinfo(uri, asecurity_or_aloadinfo); } else { channel = services.io.newchannel(aboutpage_uri, null, null); } channel.originaluri = auri; return channel; } } class factory { constructor(component) { this.component = component; this.register(); object.freeze(this); } createinstance(outer, iid) { if (outer) { throw cr.ns_error_no_aggregation; } return new this.component(); } register() { cm.registerfactory(this.component.classid, this.component.classdescription, this.component.contractid, this); } unregister() { cm.unregis...
...terfactory(this.component.prototype.classid, this); } } instantiation firefox 4+ now in the startup procedure of your bootstrapped addon make sure to do register the factory, for example: let factory; function startup(adata, areason) { // ...
... factory.unregister(); // ....
How to convert an overlay extension to restartless - Archive of obsolete content
step 7: manually handle global css stylesheets any global css style sheets which you are using will need to be registered upon load and unregistered when your extension is unloaded.
... // load stylesheets let stylesheetservice= components.classes["@mozilla.org/content/style-sheet-service;1"] .getservice(components.interfaces.nsistylesheetservice); for (let i=0,len=stylesheets.length;i<len;i++) { let stylesheeturi = services.io.newuri(stylesheets[i], null, null); stylesheetservice.loadandregistersheet(stylesheeturi, stylesheetservice.author_sheet); } ...
... // unload stylesheets let stylesheetservice = components.classes["@mozilla.org/content/style-sheet-service;1"] .getservice(components.interfaces.nsistylesheetservice); for (let i=0,len=stylesheets.length;i<len;i++) { let stylesheeturi = services.io.newuri(stylesheets[i], null, null); if (stylesheetservice.sheetregistered(stylesheeturi, stylesheetservice.author_sheet)) { stylesheetservice.unregistersheet(stylesheeturi, stylesheetservice.author_sheet); } } ...
...instead of directly calling your tear down function, make your unloadfromwindow() something like this: function unloadfromwindow(window) { var event = window.document.createevent("event"); event.initevent("myaddonname-unload",false,false); window.dispatchevent(event); } in each window you can then register on startup to listen for your custom "myaddonname-unload" event and just tear down and clean up when that event or a regular "unload" event comes in.
LIR - Archive of obsolete content
category op code code name return type featured description miscellaneous 0 start void start of a fragment 1 regfence void a register fence causes no code to be generated, but it affects register allocation so that no registers are live when it is reached.
... 3 parami integer 32 bit load an int parameter (register or stack location).
... 4 paramq quad 64 bit load a quad parameter (register or stack location).
... it indicates that the double result is returned via two 32-bit integer registers.
RDF Datasource How-To - Archive of obsolete content
[more info on what each method needs to do here] rdf commands [describe what commands are, and why you'd implement them.] registering the datasource component a datasource is an xpcom component.
...the dll must be located in the xpcom components directory a factory that is registered to an xpcom progid in order to be instantiated from the repository.
...registering an rdf datasource is fairly simple: in the dll's nsregisterself() method, you simply call the component manager's registercomponent() method: extern "c" pr_implement(nsresult) nsregisterself(nsisupports* aservicemanager, const char* apath) { nsresult rv; ...
... // assume compmgr refers to the component manager rv = compmgr->registercomponent(kmydatasourcecid, "my data source", ns_rdf_datasource_progid_prefix "my-datasource", apath, pr_true, pr_true); ...
Complete - Archive of obsolete content
when you restart after installing the extension, the locales en-us and fr-fr are both registered for the component allcustom.
... when you restart after installing the extension, the skins classic and modern are both registered for the component allcustom.
...and seamonkey's different registration mechanisms to register different files where this is needed.
...to resolve the conflict, this extension registers seamonkey's skins in a seamonkey subdirectory.
Using the Editor from XUL - Archive of obsolete content
nseditorshell is able to observe the document load on the <iframe>, because it implements nsidocumentloaderobserver, and registered itself as a doc loader when it was assigned the content window.
...in order to receive these events, the editor registers several event listeners on the document being edited.
... the following event listeners are registered: in nshtmleditor::installeventlisteners(), we install the following.
... nseditorshellmouselistener this is an odd-man-out event listener, in that it's registered from the editorshell, rather than internally to the editor.
XULRunner 1.8.0.4 Release Notes - Archive of obsolete content
to register xulrunner with the system, open a command prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only).
... register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only).
... uninstalling xulrunner linux from a command prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation.
... 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.
XULRunner 1.9.1 Release Notes - Archive of obsolete content
to register xulrunner with the system, open a command prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only).
... register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only).
... uninstalling xulrunner linux from a command prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation.
... 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.
XULRunner 1.9.2 Release Notes - Archive of obsolete content
to register xulrunner with the system, open a command prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only).
...register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only).
... uninstalling xulrunner linux from a command prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation.
... 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.
XULRunner 1.9 Release Notes - Archive of obsolete content
to register xulrunner with the system, open a command prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only).
... register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only).
... uninstalling xulrunner linux from a command prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation.
... 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.
Deploying XULRunner - Archive of obsolete content
note: to actually install a xulrunner application, a compatible version of xulrunner must be registered on the system and the app must be deployed per the instructions at xul application packaging.
... if your installer is capable of determining whether or not xulrunner has been registered on the system you could perform the check and register the appropriate version if necessary.
... after that, the app could be installed to the registered xulrunner and appear in start menus, lists of installed programs, etc.
... it may turn out to be easier to create a self contained portable application, as described here, and deploy it with a generic installer that would create shortcuts to scripts that launch your application in the unregistered bundled xulrunner.
What is a Domain Name? - Learn web development
ientdeleteprohibited domain status: clienttransferprohibited domain status: clientupdateprohibited registrant id:mmr-33684 registrant name:dns admin registrant organization:mozilla foundation registrant street: 650 castro st ste 300 registrant city:mountain view registrant state/province:ca registrant postal code:94041 registrant country:us registrant phone:+1.6509030800 as you can see, i can't register mozilla.org because the mozilla foundation has already registered it.
... on the other hand, let's see if i could register afunkydomainname.org: $ whois afunkydomainname.org not found as you can see, the domain does not exist in the whois database (at the time of writing), so we could ask to register it.
... the registrar will let you know when the domain name is properly registered.
... if your computer does not know which ip is behind the mozilla.org name, it goes on to ask a dns server, whose job is precisely to tell your computer which ip address matches each registered domain name.
Limitations of frame scripts
for example: nsinavhistoryservice nsinavbookmarksservice observers in the content process as noted in observers in the chrome process, most observers should be registered in the chrome process and will not work in the content process.
... the exceptions are: content-document-global-created document-element-inserted outer-window-destroyed inner-window-destroyed dom-window-destroyed these must be registered in the content process.
... nsiaboutmodule by default, custom about: pages registered using nsiaboutmodule are loaded in the chrome process.
... you can change this default in the code you use to register the about: uri.
Overview of Mozilla embedding APIs
the component manager allows new instances of registered xpcom components to be instantiated.
...the component manager is also responsible for registering and managing the class factories used for component creation...
...if no registered content handlers are available, the unknowncontenttypehandler is notified.
...none interface definition: nsiservicemanager.h nsicomponentmanager this interface allows new instances of registered xpcom components to be instantiated.
How to implement a custom autocomplete search component
ll); listener.onsearchresult(this, autocomplete_result); }, /** * stops an asynchronous search that is in progress */ stopsearch: function() { }, queryinterface: xpcomutils.generateqi([ ci.nsiautocompletesearch ]) }; // the following line is what xpcom uses to create components const nsgetfactory = xpcomutils.generatensgetfactory([ providerautocompletesearch ]); then register your xpcom component.
...is; } }; // factory var simpleautocompletesearchfactory = { singleton: null, createinstance: function (aouter, aiid) { if (aouter != null) throw components.results.ns_error_no_aggregation; if (this.singleton == null) this.singleton = new simpleautocompletesearch(); return this.singleton.queryinterface(aiid); } }; // module var simpleautocompletesearchmodule = { registerself: function(acompmgr, afilespec, alocation, atype) { acompmgr = acompmgr.queryinterface(components.interfaces.nsicomponentregistrar); acompmgr.registerfactorylocation(class_id, class_name, contract_id, afilespec, alocation, atype); }, unregisterself: function(acompmgr, alocation, atype) { acompmgr = acompmgr.queryinterface(components.interfaces.nsicomponentregistrar); acomp...
...mgr.unregisterfactorylocation(class_id, alocation); }, getclassobject: function(acompmgr, acid, aiid) { if (!aiid.equals(components.interfaces.nsifactory)) throw components.results.ns_error_not_implemented; if (acid.equals(class_id)) return simpleautocompletesearchfactory; throw components.results.ns_error_no_interface; }, canunload: function(acompmgr) { return true; } }; // module initialization function nsgetmodule(acompmgr, afilespec) { return simpleautocompletesearchmodule; } starting in gecko 2.0, component registration has been changed, so you need to make the following changes: add an nsgetfactory() function: function nsgetfactory(cid) { if (cid.tostring().touppercase() != class_id.tostring().touppercase()) { throw components.
...results.ns_error_factory_not_registered; } return simpleautocompletesearchfactory; } you need to explicitly register the component by adding these lines into your chrome.manifest file: component {6224daa1-71x2-4d1a-ad90-01ca1c08e323} components/.js contract @mozilla.org/autocomplete/search;1?name=simple-autocomplete {6224daa1-71x2-4d1a-ad90-01ca1c08e323} you need to add the following method: getlabelat: function(index) { return this._results[index]; } to simpleautocompleteresult use this newly available component in a xul file like this: <textbox id="text1" type="autocomplete" autocompletesearch="simple-autocomplete" showcommentcolumn="true" autocompletesearchparam='[{"value":"mark","comment":"cool dude"},{"value":"mary","c...
JavaScript-DOM Prototypes in Mozilla
during startup, the nsdomclassinfo code registers two different types of "global names", these are names of properties of the global object with special meaning to the dom code.
... this registration is done with the nsscriptnamespacemanager, which is in charge of keeping track of what names are registered in the global namespace, and what kinds of names those names are (i.e.
...when a class constructor name is registered (nsglobalnamestruct::etypeclassconstructor), the nsscriptnamespacemanager is given a dom class info id (a 32 bit id that identifies class info defined in nsdomclassinfo).
... when a class prototype name is registered (nsglobalnamestruct::etypeclassproto), the nsscriptnamespacemanager is given the nsiid of the interface that is inherited by the class which the registered name is a prototype of (e.g.
Necko Architecture
a protocol handler's primary responsibility is to create channels for the scheme it has registered to handle.
... for example, the http protocol handler registers itself as the protocol handler for "http." the http protocol handler creates http channels for http urls.
...the primary responsibility of protocol handlers is to create channel instances that know how to interpret the protocol that the handler registered for.
...after registering your protocol handler necko will use it to create channels for any uris it encounters that have the scheme your protocol handler registered for.
TPS Tests
} note that in this example, the foobar@restmail.net account must be registered on stage, otherwise authentication will fail (and the whole test will fail as well.
... after the phases run, two additional "cleanup" phases are run, to unregister the devices with fxa.
...that's what that phase is doing, it does any necessary cleanup for the phase, primarially unregistering the device associated with that profile.
... (implementation detail) two final cleanup phases are run to wipe the server state and unregister devices.
Web Replay
snapshots late in process initialization the first snapshot is taken, which is simply a copy of the stacks/registers for each thread.
... each subsequent snapshot includes copies of thread stacks/registers as well as a diff containing the original contents of all pages of heap and static memory that were modified since the previous snapshot.
... once all thread are idle, the main thread computes the memory diff, reads the stacks from each thread and their register state (which each thread recorded by calling setjmp before idling).
... threads are individually responsible for restoring their stacks; when they wake up from the idle state they see the main thread has prepared a new stack to restore to, so they longjmp to the new register state and copy in the new stack's contents.
Finishing the Component
the component will be recognized by xpcom and registered with the category manager so that it starts up when xpcom initializes.
... ns_impl_isupports3(weblock, nsiobserver, iweblock, nsicontentpolicy); receiving notifications to receive notifications, you must register as a new category.
... you have already registered as a category to receive startup notification.
... "weblock", weblock_contractid, pr_true, pr_true, &previous); if (previous) nsmemory::free(previous); return rv; } this code adds a new category entry under the topic "content-policy," and it calls addcategoryentry in the same way we did in registering for notifications.
mozIStorageFunction
objects implementing this interface can be registered with mozistorageconnection.createfunction().
...this is called by the database engine when the function registered with mozistorageconnection.createfunction() is used in an executing sql statement or trigger.
...var squarefunction = { onfunctioncall: function(aarguments) { let value = aarguments.getint32(0); return value * value; } }; // now, register our function with the database connection.
...esult) { print32 value; nsresult rv = aarguments->getint32(&value); ns_ensure_success(rv, rv); nscomptr<nsiwritablevariant> result = do_createinstance("@mozilla.org/variant;1"); ns_ensure_true(result, ns_error_out_of_memory); rv = result->setasint64(value * value); ns_ensure_success(rv, rv); ns_addref(*_result = result); return ns_ok; } }; // now, register our function with the database connection.
nsIMsgSearchSession
nand = false; searchsession.appendterm(searchterm); searchsession.search(null); inherits from: nsisupports method overview void addsearchterm(in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value, in boolean booleanand, in string arbitraryheader); nsimsgsearchterm createterm(); void appendterm(in nsimsgsearchterm term); void registerlistener(in nsimsgsearchnotify listener); void unregisterlistener(in nsimsgsearchnotify listener); void getnthsearchterm(in long whichterm, in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value); long countsearchscopes(); void getnthsearchscope(in long which,out nsmsgsearchscopevalue scopeid, out nsimsgfolder folder); vo...
... createterm() nsimsgsearchterm createterm(); appendterm() void appendterm(in nsimsgsearchterm term); parameters term registerlistener() adds a listener to the search session.
... void registerlistener(in nsimsgsearchnotify listener); parameters listener unregisterlistener() removes a listener from the search session.
... void unregisterlistener (in nsimsgsearchnotify listener); parameters listener getnthsearchterm() void getnthsearchterm(in long whichterm, in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value); parameters whichterm attrib op value note: this parameter should be an out.
nsIObserverService
verservice); method overview void addobserver( in nsiobserver anobserver, in string atopic, in boolean ownsweak); nsisimpleenumerator enumerateobservers( in string atopic ); void notifyobservers( in nsisupports asubject, in string atopic, in wstring somedata ); void removeobserver( in nsiobserver anobserver, in string atopic ); methods addobserver() registers a given listener for a notifications regarding the specified topic.
...(in most cases, you should use false.) enumerateobservers() called to enumerate all observers registered for a particular topic.
... return value returns an enumeration of all registered listeners.
... removeobserver() this method is called to unregister an observer for a particular topic.
nsIPrintingPrompt
the service is automatically registered at start up.
...if you wish to have a native progress dialog on windows you will have to create and register your own service.
... note: the windows version mozilla implements this service which is automatically built and registered for you.
... webprogresslistener additional listener can be registered for progress notifications.
nsIRadioInterfaceLayer
nterfaces.nsiradiointerfacelayer); method overview void answercall(in unsigned long callindex); void deactivatedatacall(in domstring cid, in domstring reason); void dial(in domstring number); void enumeratecalls(in nsiriltelephonycallback callback); void getdatacalllist(); unsigned short getnumberofmessagesfortext(in domstring text); void hangup(in unsigned long callindex); void registercallback(in nsiriltelephonycallback callback); void registerdatacallcallback(in nsirildatacallback callback); void rejectcall(in unsigned long callindex); void sendsms(in domstring number, in domstring message, in long requestid, in unsigned long long processid); void setupdatacall(in long radiotech, in domstring apn, in domstring user, in domstring passwd, in long chappap, in domstring pd...
...ptype); void starttone(in domstring dtmfchar); void stoptone(); void unregistercallback(in nsiriltelephonycallback callback); void unregisterdatacallcallback(in nsirildatacallback callback); attributes attribute type description currentstate jsval read only.
...hangup() void hangup( in unsigned long callindex ); parameters callindex missing description exceptions thrown missing exception missing description registercallback() void registercallback( in nsiriltelephonycallback callback ); parameters callback missing description exceptions thrown missing exception missing description registerdatacallcallback() void registerdatacallcallback( in nsirildatacallback callback ); parameters callback missing description exceptions thrown missing exception missing description rejectcall() void rejectcall(...
...exceptions thrown missing exception missing description unregistercallback() void unregistercallback( in nsiriltelephonycallback callback ); parameters callback missing description exceptions thrown missing exception missing description unregisterdatacallcallback() void unregisterdatacallcallback( in nsirildatacallback callback ); parameters callback missing description exceptions thrown missing exception missing description remarks see also ...
Troubleshooting XPCOM components registration
often the first time you create an xpcom component, it may fail to register correctly.
...you can be certain that a component has failed to register by going to the error console and evaluating components.classes["contract-id"].name where contract-id is your contract id.
... if the response is your contract id instead of an error, the component was successfully registered and this is the wrong page.
... registration failure if the module is loading correctly but doesn't register its components, try adding calls to components.utils.reporterror("debug me!"); in nsgetmodule() and other functions to try and find any errors.
Mail and RDF
queryinterface(components.interfaces.nsimsgfolder); if (property == msgcountarc) { var msgcount = folder.gettotalmessages(false); var result = rdf.getliteral(msgcount.tostring()); return result; } } asynchronously notifying rdf when a mail object's data changes and the data is reflected in rdf by notifying all of the observers that rdf has registered with the datasource.
... in the example of mail folders, each folder datasource first registers itself with the mail session as a nsifolderlistener because it wants information about when a folder changes.
... each template registers itself as an rdf observer.
... the calling chain essentially looks like this: registration: folder datasource registers itself with the mail session as a folder listener rdf template registers itself with the datasource as a content observer.
Mail event system
if the object wants to know about all notifications on all folders, then it should register with the mail session.
...the mail session receives all notifications from all folders, and then forwards it on to any nsifolderlisteners that have registered themselves.
... notifypropertychanged then broadcasts this event to the mail session: mailsession->onintpropertychanged(this, ktotalmessagesatom, 4, 5); the mail session rebroadcasts this information to each of the global listeners that has been registered with it.
...tychanged, onitemboolpropertychanged: function(item, property, oldvalue, newvalue) {}, onitemunicharpropertychanged: function(item, property, oldvalue, newvalue) {}, onitempropertyflagchanged: function(item, property, oldflag, newflag) {}, onitemevent: function(item, event) = {}, onfolderloaded: function(afolder) = {} ondeleteormovemessagescompleted: function( afolder) = {}, } // now register myself as a listener on every mail folder var mailsession = components.classes["component://netscape/messenger/services/session"].
Standard OS Libraries
to call objective-c based api from ctypes, use the following functions in libobjc.dylib: objc_getclass to get class sel_registername to register selector name objc_msgsend and some variants to send message to class and instance objective-c code can be translated into c code by the following rule: // objective-c code nsevent loc = [nsevent mouselocation]; // pseudo c code nsevent loc = (nspoint)objc_msgsend(objc_getclass("nsevent"), sel_registername("mouselocation")); example: [nse...
...utils.import("resource://gre/modules/ctypes.jsm"); let objc = ctypes.open(ctypes.libraryname("objc")); let id = ctypes.structtype("objc_object").ptr; let sel = ctypes.structtype("objc_selector").ptr; let objc_getclass = objc.declare("objc_getclass", ctypes.default_abi, id, ctypes.char.ptr); 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, ...
...ctypes.float : ctypes.double; // 64bit its double, in 32bit its float let nspoint = new ctypes.structtype("nspoint", [ { "x" : cgfloat }, { "y" : cgfloat } ]); // note: [nsevent mouselocation] returns nspoint struct, // which is small enough to return in register, // so we don't need to use objc_msgsend_stret.
...let objc_msgsend_nspoint = objc.declare("objc_msgsend", ctypes.default_abi, nspoint, id, sel, "..."); // loc = [nsevent mouselocation] let nsevent = objc_getclass("nsevent"); let mouselocation = sel_registername("mouselocation"); let loc = objc_msgsend_nspoint(nsevent, mouselocation); components.utils.reporterror(loc); objc.close(); resources for cocoa googlecode :: js-macosx - lightweight bridge for calling cocoa frameworks from mozilla javascript unmht blog :: js-ctypes and objc - blog entries on using objective-c from js-ctypes githubgists :: noitidart / search · objc - objective-c js-c...
Edit fonts - Firefox Developer Tools
there are several registered axes.
... although it isn't required that these axes be defined for every font, if the font designer does implement a registered axis, its behavior must follow the defined behavior.
... here are the registered axes along with their corresponding css properties: axis tag css property "wght" font-weight "wdth" font-stretch "slnt" (slant) font-style: oblique + angle "ital" font-style: italic "opsz" font-optical-sizing any axis that is not on the list of registered axes is considered a custom axis.
... note: registered axis tags are identified using lower-case tags, whereas custom axes should be given upper-case tags.
about:debugging - Firefox Developer Tools
workers the workers section shows all the workers you've got registered on your firefox, categorised as follows: all registered service workers all registered shared workers other workers, including chrome workers and dedicated workers you can connect the developer tools to each worker, and send push notifications to service workers.
...three states are possible: registering: this covers all states between the service worker's initial registration, and its assuming control of pages.
... note: from firefox 79 onwards, you can access similar information on the service workers registered on a particular domain by going to the firefox devtools application panel.
... unregistering service workers click the unregister button to unregister the service worker.
AudioWorkletGlobalScope - Web APIs
methods registerprocessor() registers a class derived from the audioworkletprocessor interface.
... the class can then be used by creating an audioworkletnode, providing its registered name.
... first we need to define the processor, and register it.
... outputs, parameters) { return true } } // the sample rate is not going to change ever, // because it's a read-only property of a baseaudiocontext // and is set only during its instantiation console.log(samplerate) // you can declare any variables and use them in your processors // for example it may be an arraybuffer with a wavetable const usefulvariable = 42 console.log(usefulvariable) registerprocessor('test-processor', testprocessor) next, in our main scripts file we'll load the processor, create an instance of audioworkletnode — passing the name of the processor to it — and connect the node to an audio graph.
ContentIndex.add() - Web APIs
WebAPIContentIndexadd
the add() method of the contentindex interface registers an item with the content index.
... syntax contentindex.add(contentdescription).then(...); parameters contentdescription the item registered is an object containing the following data: id: a unique string identifier.
... examples here we're declaring an item in the correct format and creating an asynchronous function which uses the add method to register it with the content index.
... // our content const item = { id: 'post-1', url: '/posts/amet.html', title: 'amet consectetur adipisicing', description: 'repellat et quia iste possimus ducimus aliquid a aut eaque nostrum.', icons: [{ src: '/media/dark.png', sizes: '128x128', type: 'image/png', }], category: 'article' }; // our asynchronous function to add indexed content async function registercontent(data) { const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) { return; } // register content try { await registration.index.add(data); } catch (e) { console.log('failed to register content: ', e.message); } } the add method can also be used within the service worker scope.
Pointer events - Web APIs
registering event handlers this example registers a handler for every event type for the given element.
...event) { } function down_handler(event) { } function move_handler(event) { } function up_handler(event) { } function cancel_handler(event) { } function out_handler(event) { } function leave_handler(event) { } function gotcapture_handler(event) { } function lostcapture_handler(event) { } function init() { var el=document.getelementbyid("target"); // register pointer event handlers el.onpointerover = over_handler; el.onpointerenter = enter_handler; el.onpointerdown = down_handler; el.onpointermove = move_handler; el.onpointerup = up_handler; el.onpointercancel = cancel_handler; el.onpointerout = out_handler; el.onpointerleave = leave_handler; el.gotpointercapture = gotcapture_handler; el.lost...
...ed"); } // call the tilt handler if (ev.tiltx != 0 && ev.tilty != 0) process_tilt(ev.tiltx, ev.tilty); // call the pressure handler process_pressure(ev.pressure); // if this event is not primary, call the non primary handler if (!ev.isprimary) process_non_primary(ev); } function init() { var el=document.getelementbyid("target"); // register pointerdown handler el.onpointerdown = down_handler; } </script> <body onload="init();"> <div id="target"> touch me ...
...document.getelementbyid("target"); // element "target" will receive/capture further events el.setpointercapture(ev.pointerid); } function cancelhandler(ev) { let el = document.getelementbyid("target"); // release the pointer capture el.releasepointercapture(ev.pointerid); } function init() { let el = document.getelementbyid("target"); // register pointerdown and pointercancel handlers el.onpointerdown = downhandler; el.onpointercancel = cancelhandler; } </script> <body onload="init();"> <div id="target"> touch me ...
PushManager - Web APIs
pushmanager.register() subscribes to a push subscription.
... pushmanager.unregister() unregisters and deletes a specified subscription endpoint.
... in the updated api, a subscription is unregistered by calling the pushsubscription.unsubscribe() method.
...} navigator.serviceworker.register('serviceworker.js').then( function(serviceworkerregistration) { serviceworkerregistration.pushmanager.subscribe().then( function(pushsubscription) { console.log(pushsubscription.endpoint); // the push subscription details needed by the application // server are now available, and can be sent to it using, // for example, an xmlhttprequest.
Service Worker API - Web APIs
service worker concepts and usage a service worker is an event-driven worker registered against an origin and a path.
... registration a service worker is first registered using the serviceworkercontainer.register() method.
... serviceworkercontainer provides an object representing the service worker as an overall unit in the network ecosystem, including facilities to register, unregister, and update service workers, and access the state of service workers and their registrations.
... syncmanager provides an interface for registering and listing sync registrations.
Using custom elements - Web Components
high-level view the controller of custom elements on a web document is the customelementregistry object — this object allows you to register a custom element on the page, return information on what custom elements are registered, etc.
... to register a custom element on the page, you use the customelementregistry.define() method.
...etattribute('class','info'); // take attribute content and put it inside the info span info.textcontent = this.getattribute('data-text'); // create some css to apply to the shadow dom const style = document.createelement('style'); style.textcontent = '.wrapper {' + // css truncated for brevity // attach the created elements to the shadow dom this.shadowroot.append(style,wrapper); finally, we register our custom element on the customelementregistry using the define() method we mentioned earlier — in the parameters we specify the element name, and then the class name that defines its functionality: customelements.define('popup-info', popupinfo); it is now available to use on our page.
... next, we register the element using the define() method as before, except that this time it also includes an options object that details what element our custom element inherits from: customelements.define('expanding-list', expandinglist, { extends: "ul" }); using the built-in element in a web document also looks somewhat different: <ul is="expanding-list"> ...
Web Components
register your new custom element using the customelementregistry.define() method, passing it the element name to be defined, the class or function in which its functionality is specified, and optionally, what element it inherits from.
... reference custom elements customelementregistry contains functionality related to custom elements, most notably the customelementregistry.define() method used to register new custom elements so they can then be used in your document.
... extensions for creating custom built-in elements the is global html attribute: allows you to specify that a standard html element should behave like a registered custom built-in element.
... the "is" option of the document.createelement() method: allows you to create an instance of a standard html element that behaves like a given registered custom built-in element.
content/worker - Archive of obsolete content
onmessage function functions that will registered as a listener to a 'message' events.
... onerror function functions that will registered as a listener to an 'error' events.
... destroy() destroy the worker by removing the content script from the page and removing all registered listeners.
system/unload - Archive of obsolete content
experimental register callbacks that are called when a module is unloaded.
... therefore, when you register an object with ensure(), you can call its destructor method yourself, you can let it happen for you, or you can do both.
... when(callback) registers a function to be called when the module is unloaded.
Install Manifests - Archive of obsolete content
this object has a package property (with a path within the jar file or directory that leads to the location where the contents.rdf file responsible for registering that package is located), a locale property (ditto, but to register the locale) and a skin property (ditto, but to register the theme material).
... in extensions for firefox 1.5, this property is no longer necessary: the chrome.manifest at the top level of the xpi is used to locate chrome to register.
... examples <em:file> <description about="urn:mozilla:extension:file:myext.jar"> <em:package>content/myext/</em:package> <em:locale>locale/myext/</em:locale> <em:skin>skin/classic/myext/<em:skin> </description> </em:file> an install manifest may specify multiple file properties, one for each jar file or subdirectory that contains chrome to register.
Jetpack Processes - Archive of obsolete content
registerreceiver(amessagename, areceiver) similar to nsijetpack.registerreceiver(), this function registers a callback that is triggered when the chrome process sends a message with the given name.
... unregisterreceiver(amessagename, areceiver) similar to nsijetpack.unregisterreceiver(), this function unregisters a callback previously registered with registerreceiver().
... unregisterreceivers(amessagename) similar to nsijetpack.unregisterreceivers(), this function unregisters all callbacks for the given message name.
Structure of an installable bundle - Archive of obsolete content
additional resources (such as chrome:// or resource:// providers can be registered in the chrome.manifest) application-specific /searchplugins/*.src sherlock search plugins firefox 1.5 and greater.
...themes are limited for security reasons, and can normally only provide a chrome.manifest which registers the theme and a jar file.
...gcc3/plugins/libmyplugin.dylib because xpt files are not platform-specific, any associated xpt files would go in the generic components directory: /components/myplugin.xpt if an extension has non-binary platform-specific code (such as code which uses the windows registry from script), it can also use just the operating system identifier as a platform-subdirectory: /platform/winnt/components/registerdoctype.js when platform-specific jar files are used, each platform directory should have its own chrome.manifest file: chrome.manifest chrome/mytheme-base.jar platform/darwin/chrome.manifest platform/darwin/chrome/mytheme-mac.jar platform/winnt/chrome.manifest platform/winnt/chrome/mytheme-win.jar the app/extension loader processes the base directory first, followed by the applicable platfor...
Creating a Firefox sidebar extension - Archive of obsolete content
a newer document is available: creating a firefox sidebar this article describes how to create a registered sidebar for firefox 2 or greater.
...what we will do is create a sidebar and register it so it will be available in the menu.
...<?xml-stylesheet href="chrome://browser/skin/browser.css" type="text/css" ?> <!doctype page system "chrome://emptysidebar/locale/emptysidebar.dtd"> <page id="sbemptysidebar" title="&emptysidebar.title;" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" > <vbox flex="1"> <label id="atest" value="&emptysidebar.title;" /> </vbox> </page> new extensions can be registered in the menus or popups, firefox uses overlays for extending menus.
GRE Registration - Archive of obsolete content
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.
...xulrunner rpms/post-install scripts should register xulrunner as a gre by running <tt>xulrunner -register-global</tt> and not hand-create a .conf file.
... the <tt>-register-global</tt> flag has special fallback semantics so that multiple xulrunners of the same version can be installed without overwriting registration files.
JavaScript crypto - Archive of obsolete content
you can then register event handlers for these events with the document.addeventlistener() method.
...<script> function onsmartcardchange() { window.location.reload(); } function register() { window.crypto.enablesmartcardevents = true; document.addeventlistener("smartcard-insert", onsmartcardchange, false); document.addeventlistener("smartcard-remove", onsmartcardchange, false); } function deregister() { document.removeeventlistener("smartcard-insert", onsmartcardchange, false); document.removeeventlistener("smartcard-remove", onsmartcardchange, false); } document.body.onload = register; document.
...body.onunload = deregister; </script> with the above example, your web site will automatically reload anytime a smartcard is inserted or removed.
Methods - Archive of obsolete content
deleteregisteredfile deletes the specified file and its entry in the client version registry.
... refreshplugins refreshes the list of plug-ins registered for the browser.
... registerchrome registers chrome with the chrome registry.
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
copy and paste the line from here, to avoid typing errors: content,install,url,resource:/chrome/custombutton/ explanation: this line registers your custom toolbar button extension, linking it into seamonkey.
...after changing contents.rdf, delete the files chrome.rdf and overlays.rdf so that seamonkey registers the change the next time it starts.
... in your working directory, create a plain text file named: install.js copy the following content, and paste it into the new file: const title = "custom toolbar button" const name = "custombutton" const version = "1.0" r = initinstall(title, name, version) || adddirectory(null, "content", getfolder("chrome"), name) || registerchrome(content + delayed_chrome, getfolder("chrome", name), "") if (r) cancelinstall(r) else performinstall(), alert("now restart seamonkey") customize the title, name and (optionally) version definitions, changing the text between double-quote characters on those three lines.
XUL Structure - Archive of obsolete content
for this reason, mozilla provides a method of installing content locally and registering the installed files as part of its chrome system.
...registered packages are not required to use overlays, of course.
...however, this xul code will be registered in the chrome system such that the application can display the ui.
XULRunner 1.8.0.1 Release Notes - Archive of obsolete content
to register xulrunner with the system, open a command prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only).
... register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only).
... uninstalling xulrunner windows/linux from a command prompt, run xulrunner --unregister-global or xulrunner --unregister-user to unregister xulrunner just as you registered it during installation.
XULRunner tips - Archive of obsolete content
lectedskin", "classic/1.0"); // nb these point at amo pref("extensions.update.url", "chrome://mozapps/locale/extensions/extensions.properties"); pref("extensions.getmoreextensionsurl", "chrome://mozapps/locale/extensions/extensions.properties"); pref("extensions.getmorethemesurl", "chrome://mozapps/locale/extensions/extensions.properties"); if your application is based on gecko 2.0, you need to register a component through the new component registration because the extension manager uses fuel, namely application.restart(), to restart your xulrunner-based application after any change (installation, removal, enabling, disabling) in the extensions' list: copy files fuelapplication.js and fuelapplication.manifest from browser/fuel/src for instance into your components/ directory tweak the line #...
...in order to satisfy these dependencies, you can save firefox's brand.dtd/brand.properties to chrome/locale/branding folder, modify them appropriately, and register a locale provider for branding by adding the following line to your chrome manifest: locale branding en-us chrome/locale/branding/ the location you put the branding files in doesn't matter, as long as you register it appropriately in the manifest.
... in addition, a branding content package must be registered to include the application logos: content branding chrome/branding/ 3 files should be provided in this folder: about.png, icon48.png and icon64.png.
Creating a Login Manager storage module
register that interface in a specific category.
...resource://gre/modules/xpcomutils.jsm"); function sampleloginmanagerstorage() {} sampleloginmanagerstorage.prototype = { classdescription: "sample nsiloginmanagerstorage implementation", contractid: "@example.com/login-manager/storage/sample;1", classid: components.id("{364a118c-747a-4f6d-ac63-2d2998e5a5c1}"), queryinterface: xpcomutils.generateqi([ci.nsiloginmanagerstorage]), // this registers the category for overriding the built-in nsiloginmanagerstorage _xpcom_categories: [ { category: "login-manager-storage", entry: "nsiloginmanagerstorage" } ], // console logging service, used for debugging.
...the category registration looks like this: nscomptr<nsicategorymanager> cat = do_getservice(ns_categorymanager_contractid); ns_ensure_state(cat); cat->addcategoryentry("login-manager-storage", "nsiloginmanagerstorage", kyourcontractid, pr_true, pr_true, nsnull); don't forget to unregister the category on unload.
Process scripts
for example, in multiprocess firefox, if you need to use nsicontentpolicy to register a content policy, you must do this in the content process.
... but if you register it in a frame script, and the frame script is loaded more than once, you'll register the content policy more than once, which probably isn't what you intend.
... similarly, some observer notifications must be registered in the content process, but if you do this in a frame script, and the frame script is loaded more than once, then you will get multiple notifications for that event.
Message manager overview
process scripts are most likely to be useful when chrome code wants to run some code only once in the content process, to access some global service: for example, to register an observer or a content policy.
...this is the recommended way to load a script that executes just once per child process, which is something you might want to do if you are interacting with some global service (for example, adding listeners to observer notifications or registering components).
... this can be useful for addons to register categories, observers and components in child processes.
AddonInstall
the process will continue in the background until it fails, completes, one of the registered installlisteners pauses it, or the process is canceled by a call to the cancel() method.
... void cancel( ) addlistener() adds a new installlistener if the listener is not already registered to monitor this specific addoninstall.
... removelistener() removes an installlistener if the listener is registered for monitoring this specific addoninstall.
Add-on Manager
for example: components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getalladdons(function(aaddons) { // here aaddons is an array of addon objects }); // this code will execute before the code inside the callback notifications about changes to installed add-ons are dispatched to any registered addonlisteners.
... they must be registered through the addaddonlistener() method.
...a listener can be registered either for a specific install using the addlistener() method or for all installs using the addinstalllistener() method.
AsyncShutdown.jsm
methods overview void addblocker(string name, function|promise condition, optional function info) boolean removeblocker(function|promise condition) methods addblocker () register a blocker for the completion of a phase.
...if several blockers have been registered for the same condition, remove all these blockers.
... if no blocker has been registered for this condition, this is a noop.
DownloadList
note: when a download is added to the list, its onchange event is registered by the list, thus it cannot be used to monitor the download.
... to receive change notifications for downloads that are added to the list, use the addview() method to register for ondownloadchanged notifications.
... promise resolves to undefined when the view has been registered and all the ondownloadadded notifications for the existing downloads have been sent.
DownloadSummary
views on the summarized data can be registered before this object is bound to an actual list.
... promise resolves to undefined when the view on the underlying list has been registered.
... promise resolves to undefined when the view has been registered and the onsummarychanged notification has been sent.
Using JavaScript code modules
a javascript code module is simply some javascript code located in a registered location.
... if your extension or application needs to support mozilla 1.9.x (firefox 3.x), you should register a new resource url.
... using chrome.manifest the easiest way for extensions and xul applications to add custom aliases is by registering an alias in the chrome manifest using a line like this: resource aliasname uri/to/files/ for example, if the xpi for your foo extension includes a top-level modules/directory containing the bar.js module (that is, the modules/directory is a sibling to chrome.manifest and install.rdf), you could create an alias to that directory via the instruction: resource foo modules/ (don't forget the...
Webapps.jsm
ath: function(amanifest, adestapp) appkind: function(aapp, amanifest) updatepermissionsforapp: function(aid, aispreinstalled) updateofflinecacheforapp: function(aid) installpreinstalledapp: function installpreinstalledapp(aid) removeifhttpsduplicate: function(aid) installsystemapps: function() loadandupdateapps: function() updatedatastore: function(aid, aorigin, amanifesturl, amanifest) _registersystemmessagesforentrypoint: function(amanifest, aapp, aentrypoint) _registerinterappconnectionsforentrypoint: function(amanifest, aapp,) _registersystemmessages: function(amanifest, aapp) _registerinterappconnections: function(amanifest, aapp) _createactivitiestoregister: function(amanifest, aapp, aentrypoint, arunupdate) _registeractivitiesforapps: function(aappstoregister, arunupdate) _re...
...gisteractivities: function(amanifest, aapp, arunupdate) _createactivitiestounregister: function(amanifest, aapp, aentrypoint) _unregisteractivitiesforapps: function(aappstounregister) _unregisteractivities: function(amanifest, aapp) _processmanifestforids: function(aids, arunupdate) observe: function(asubject, atopic, adata) addmessagelistener: function(amsgnames, aapp, amm) removemessagelistener: function(amsgnames, amm) formatmessage: function(adata) receivemessage: function(amessage) getappinfo: function getappinfo(aappid) broadcastmessage: function broadcastmessage(amsgname, acontent) registerupdatehandler: function(ahandler) unregisterupdatehandler: function(ahandler) notifyupdatehandlers: function(aapp, amanifest, azippath) _getappdir: function(aid) _writefile: function(apath...
...ion(alocalid) getdefaultcspbylocalid: function(alocalid) getapplocalidbystoreid: function(astoreid) getappbylocalid: function(alocalid) getmanifesturlbylocalid: function(alocalid) getapplocalidbymanifesturl: function(amanifesturl) getcoreappsbasepath: function() getwebappsbasepath: function() _islaunchable: function(aapp) _notifycategoryandobservers: function(subject, topic, data, msg) registerbrowserelementparentforapp: function(amsg, amn) receiveappmessage: function(appid, message) _clearprivatedata: function(appid, browseronly, msg) _sendprogressevent: function() updatestatechanged: function appobs_update(aupdate, astate) applicationcacheavailable: function appobs_cacheavail(aapplicationcache) ...
NSS functions
later nss_initialize mxr 3.2 and later nss_initreadwrite mxr 3.2 and later nss_initwithmerge mxr 3.12 and later nss_isinitialized mxr 3.9.2 and later nss_nodb_init mxr 3.2 and later nss_putenv mxr 3.2 and later nss_registershutdown mxr 3.11.1 and later nss_shutdown mxr 3.2 and later nss_unregistershutdown mxr 3.11.1 and later nss_versioncheck mxr 3.2 and later nssbase64_decodebuffer mxr 3.4 and later nssbase64decoder_create mxr 3.2 and later nssbase64...
... mxr 3.2 and later sec_asn1encoderupdate mxr 3.2 and later sec_asn1encodeunsignedinteger mxr 3.11.1 and later sec_asn1lengthlength mxr 3.2 and later sec_dupcrl mxr 3.9 and later sec_getsignaturealgorithmoidtag mxr 3.10 and later sec_getregisteredhttpclient mxr 3.12 and later sec_pkcs5getcryptoalgorithm mxr 3.2 and later sec_pkcs5getkeylength mxr 3.2 and later sec_pkcs5getpbealgorithm mxr 3.2 and later sec_pkcs5isalgorithmpbealg mxr 3.2 and later sec_pkcs5isalgorithmpbealgtag mxr 3.12 and...
... later sec_registerdefaulthttpclient mxr 3.11.1 and later sec_signdata mxr 3.2 and later sec_stringtooid mxr 3.12 and later secitem_allocitem mxr 3.2 and later secitem_arenadupitem mxr 3.9 and later secitem_compareitem mxr 3.2 and later secitem_copyitem mxr 3.2 and later secitem_dupitem mxr 3.2 and later secitem_freeitem mxr 3.2 and later secitem_itemsareequal mxr 3.8 and later secitem_zfreeitem mxr 3.2 and later seckey_copyencryptedprivatekeyinfo mxr 3.2 and later ...
Utility functions
later nss_initialize mxr 3.2 and later nss_initreadwrite mxr 3.2 and later nss_initwithmerge mxr 3.12 and later nss_isinitialized mxr 3.9.2 and later nss_nodb_init mxr 3.2 and later nss_putenv mxr 3.2 and later nss_registershutdown mxr 3.11.1 and later nss_shutdown mxr 3.2 and later nss_unregistershutdown mxr 3.11.1 and later nss_versioncheck mxr 3.2 and later nssbase64_decodebuffer mxr 3.4 and later nssbase64decoder_create mxr 3.2 and later nssbase64...
... mxr 3.2 and later sec_asn1encoderupdate mxr 3.2 and later sec_asn1encodeunsignedinteger mxr 3.11.1 and later sec_asn1lengthlength mxr 3.2 and later sec_dupcrl mxr 3.9 and later sec_getsignaturealgorithmoidtag mxr 3.10 and later sec_getregisteredhttpclient mxr 3.12 and later sec_pkcs5getcryptoalgorithm mxr 3.2 and later sec_pkcs5getkeylength mxr 3.2 and later sec_pkcs5getpbealgorithm mxr 3.2 and later sec_pkcs5isalgorithmpbealg mxr 3.2 and later sec_pkcs5isalgorithmpbealgtag mxr 3.12 and...
... later sec_registerdefaulthttpclient mxr 3.11.1 and later sec_signdata mxr 3.2 and later sec_stringtooid mxr 3.12 and later secitem_allocitem mxr 3.2 and later secitem_arenadupitem mxr 3.9 and later secitem_compareitem mxr 3.2 and later secitem_copyitem mxr 3.2 and later secitem_dupitem mxr 3.2 and later secitem_freeitem mxr 3.2 and later secitem_itemsareequal mxr 3.8 and later secitem_zfreeitem mxr 3.2 and later seckey_copyencryptedprivatekeyinfo mxr 3.2 and later ...
Shell global objects
printprofilerevents() register a callback with the profiler that prints javascript profiler events to stderr.
... callback is only registered if profiling is enabled.
... enableosipointregisterchecks() emit extra code to verify live regs at the start of a vm call are not modified before its osipoint.
Embedded Dialog API
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).
...after initializing embedding, an application can override a default factory by registering its replacement.
...all ui-related code must be implemented in a registered component so that it can be swapped out by the embedding application.
Avoiding leaks in JavaScript XPCOM components
if you implement nsiobserver in javascript and register that observer (without using weak references) with a service (for example, with the observer service bug 239833 or with the pref service bug 256822), the service will do exactly what you tell it to do: notify the observer you just created until you unregister the observer.
... if you don't unregister the observer, the observer, the javascript global object for the context in which it was created, and a bunch of associated objects will all leak for the lifetime of the application.
... it's also worth noting that failing to unregister an observer that's attached to something temporary (such as a controller or event listener) can cause the garbage collector to take an extra cycle to clean up everything that was associated with a document if the temporary object itself is destroyed as a result of garbage collection.
How to build an XPCOM component in JavaScript
you can browse existing xpcom interfaces at various locations in the mozilla source code, or using xpcomviewer, a gui for browsing registered interfaces and components.
... compiling the typelib your interface definition must be compiled into a binary format (xpt) in order to be registered and used within mozilla applications.
...}, // [optional] an array of categories to register this component in.
Using XPCOM Utilities to Make Things Easier
much of the code created to get the software recognized and registered as a component can be reduced to a small data structure and a single macro.
...each structure describes a cid that is to be registered with xpcom.
... these three entries constitute the required parameters for the registerfactorylocation method we looked at in the prior chapter.
Components.classes
note that components.classes reflects only those component classes that have been previously installed and registered with the component manager using contractids.
... if you want to use a class which was only registered with their cid, use components.classesbyid instead of components.classes to retrieve it.
...if the given element in the components.classes object is not registered on the machine then trying to access it will generate a javascript warning in strict mode and the value returned will be the javascript value undefined.
mozIStorageAggregateFunction
objects implementing this interface can be registered with mozistorageconnection.createaggregatefunction().
... let ilength = this._numbers.length; this._numbers.foreach(function(elt) { total += elt }); let mean = total / this._numbers.length; let data = this._numbers.map(function(elt) { let value = elt - mean; return value * value; }); total = 0; data.foreach(function(elt) { total += elt }); this._numbers = []; return math.sqrt(total / ilength); } }; // now, register our function with the database connection.
...length(); i++) total += data[i]; nscomptr<nsiwritablevariant> result = do_createinstance("@mozilla.org/variant;1"); ns_ensure_true(result, ns_error_out_of_memory); rv = result->setasdouble(sqrt(double(total) / double(data.length()))); ns_ensure_success(rv, rv); ns_addref(*_result = result); return ns_ok; } private: nstarray<print32> mnumbers; }; // now, register our function with the database connection.
nsIContentPrefService2
name(in astring name, in nsicontentprefobserver observer); void set(in astring domain, in astring name, in nsivariant value, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void setglobal(in astring name, in nsivariant value, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); methods addobserverforname() registers an observer that will be notified whenever a preference with the given name is set() or removed.
... removeobserverforname() unregisters an observer for the given name.
... void removeobserverforname( in astring name, in nsicontentprefobserver observer ); parameters name the name for which the observer was registered.
nsIExternalProtocolService
uriloader/exthandler/nsiexternalprotocolservice.idlscriptable the external protocol service is used for finding and launching web handlers (a la registerprotocolhandler in the html5 draft) or platform-specific applications for handling particular protocols.
...specifically, this looks to see whether there are any known possible application handlers in either the nsihandlerservice datastore or registered with the os.
... see also registerprotocolhandler ...
nsIFeedResult
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void registerextensionprefix(in astring anamespace, in astring aprefix); attributes attribute type description bozo boolean the feed processor sets the bozo bit when a feed triggers a fatal error during xml parsing.
...this value will be one of the following: atom, rss2, rss09, rss091, rss091userland, rss092, rss1, atom03, atomentry, rssitem methods registerextensionprefix() registers a prefix for a namespace used to access an extension in the feed or entry.
... void registerextensionprefix( in astring anamespace, in astring aprefix ); parameters anamespace the namespace for the extension.
nsIHTMLEditor
constants constant value description eleft 0 ecenter 1 eright 2 ejustify 3 methods adddefaultproperty() registers a default style property with the editor.
... removealldefaultproperties() unregisters all default style properties with the editor.
... removedefaultproperty() unregisters a default style property with the editor.
nsIMessageWakeupService
requesting wakeups to request a wakeup, a wakeup condition must be registered with the category manager in the "wakeup-request" category.
... the easiest way to do this is to add the appropriate entry to the chrome manifest that registers your component (see category in "chrome registration").
... alternatively, it is possible to register a wakeup entry programmatically via the nsicategorymanager interface.
AudioWorkletProcessor - Web APIs
processing audio an example algorithm of creating a custom audio processing mechanism is: create a separate file; in the file: extend the audioworkletprocessor class (see "deriving classes" section) and supply your own process() method in it; register the processor using audioworkletglobalscope.registerprocessor() method; load the file using addmodule() method on your audio context's audioworklet property; create an audioworkletnode based on the processor.
... first, we need to define a custom audioworkletprocessor, which will output white noise, and register it.
... // white-noise-processor.js class whitenoiseprocessor extends audioworkletprocessor { process (inputs, outputs, parameters) { const output = outputs[0] output.foreach(channel => { for (let i = 0; i < channel.length; i++) { channel[i] = math.random() * 2 - 1 } }) return true } } registerprocessor('white-noise-processor', whitenoiseprocessor) next, in our main script file we'll load the processor, create an instance of audioworkletnode, passing it the name of the processor, then connect the node to an audio graph.
CSS Properties and Values API - Web APIs
interfaces css.registerproperty defines how a browser should parse a css custom properties.
... access this interface through css.registerproperty in javascript.
... examples the following uses css.registerproperty in javascript to type a css custom properties, --my-color, as a color, give it a default value, and not allow it to inherit its value: window.css.registerproperty({ name: '--my-color', syntax: '<color>', inherits: false, initialvalue: '#c0ffee', }); the same registration can take place in css using the following @property: @property --my-color { syntax: '<color>'; inherits: false; initial-value: #c0ffee; } specifications specification status comment css properties and values api level 1 working draft initial definition.
Event.eventPhase - Web APIs
WebAPIEventeventPhase
event listeners registered for capture mode when eventtarget.addeventlistener() was called are triggered during this phase.
...event listeners registered for this phase are called at this time.
...event listeners registered for this phase are triggered during this process.
Geolocation.watchPosition() - Web APIs
the geolocation method watchposition() method is used to register a handler function that will be called automatically each time the position of the device changes.
... return value an integer id that identifies the registered handler.
... the id can be passed to the geolocation.clearwatch() to unregister the handler.
Using IndexedDB - Web APIs
full indexeddb example html content <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <h1>indexeddb demo: storing blobs, e-publication example</h1> <div class="note"> <p> works and tested with: </p> <div id="compat"> </div> </div> <div id="msg"> </div> <form id="register-form"> <table> <tbody> <tr> <td> <label for="pub-title" class="required"> title: </label> </td> <td> <input type="text" id="pub-title" name="pub-title" /> </td> </tr> <tr> <td> <label for="pub-biblioid" class="required"> ...
...<br/> <span class="note">(same origin url)</span> </label> </td> <td> <input type="text" id="pub-file-url" name="pub-file-url"/> </td> </tr> </tbody> </table> <div class="button-pane"> <input type="button" id="add-button" value="add publication" /> <input type="reset" id="register-form-reset"/> </div> </form> <form id="delete-form"> <table> <tbody> <tr> <td> <label for="pub-biblioid-to-delete"> bibliographic id:<br/> <span class="note">(isbn, issn, etc.)</span> </label> </td> <td> <input type="text" id="pub-biblioid-to-delete"...
..."failure: " + msg : "failure"; $('#msg').html('<span class="action-failure">' + msg + '</span>'); } function resetactionstatus() { console.log("resetactionstatus ..."); $('#msg').empty(); console.log("resetactionstatus done"); } function addeventlisteners() { console.log("addeventlisteners"); $('#register-form-reset').click(function(evt) { resetactionstatus(); }); $('#add-button').click(function(evt) { console.log("add ..."); var title = $('#pub-title').val(); var biblioid = $('#pub-biblioid').val(); if (!title || !biblioid) { displayactionfailure("required field(s) missing"); return; } var year = $('#pub-year').val(); if (ye...
Navigator - Web APIs
WebAPINavigator
it allows scripts to query it and to register themselves to carry on some activities.
... navigator.registercontenthandler() obsolete since gecko 59 allows web sites to register themselves as a possible handler for a given mime type.
... navigator.registerprotocolhandler() allows web sites to register themselves as a possible handler for a given protocol.
PaintWorklet - Web APIs
paintworklet.registerpaint() registers a class programmatically generate an image where a css property expects a file.
...note that registerpaint() is called without a reference to paintworklet.
...x` as if it was a normal canvas const colors = ['red', 'green', 'blue']; const size = 32; for(let y = 0; y < geom.height/size; y++) { for(let x = 0; x < geom.width/size; x++) { const color = colors[(x + y) % colors.length]; ctx.beginpath(); ctx.fillstyle = color; ctx.rect(x * size, y * size, size, size); ctx.fill(); } } } } // register our class under a specific name registerpaint('checkerboard', checkerboardpainter); load a paintworklet the following example demonstrates loading the above worklet from its js file and does so by feature detection.
ServiceWorker - Web APIs
a serviceworker object is available in the serviceworkerregistration.active property, and the serviceworkercontainer.controller property — this is a service worker that has been activated and is controlling the page (the service worker has been successfully registered, and the controlled page has been reloaded.) the serviceworker interface is dispatched a set of lifecycle events — install and activate — and functional events including fetch.
...the url must be on the same origin as the document that registers the serviceworker.
... if ('serviceworker' in navigator) { navigator.serviceworker.register('service-worker.js', { scope: './' }).then(function (registration) { var serviceworker; if (registration.installing) { serviceworker = registration.installing; document.queryselector('#kind').textcontent = 'installing'; } else if (registration.waiting) { serviceworker = registration.waiting; document.queryselector...
Attestation and Assertion - Web APIs
attestation when an authenticator registers a new key pair with a service, the authenticator signs the public key with an attestation certificate.
...when registering an authenticator for a new account, typically a trust on first use (tofu) model applies; and when adding an authenticator to an existing account, a user has already been authenticated and has established a secure session.
... assertion when a user chooses to log into a service, the server sends a challenge and the authenticator signs over it with a key pair previously registered to that service.
Window - Web APIs
WebAPIWindow
window.customelements read only returns a reference to the customelementregistry object, which can be used to register new custom elements and get information about previously registered custom elements.
... methods implemented from elsewhere eventtarget.addeventlistener() register an event handler to a specific event type on the window.
... window.captureevents() registers the window to capture all events of the specified type.
CSS Houdini
<script> css.paintworklet.addmodule('csscomponent.js'); </script> this added module contains registerpaint() functions, which register completely configurable worklets.
... css properties and values api defines an api for registering new css properties.
... properties registered using this api are provided with a parse syntax that defines a type, inheritance behaviour, and an initial value.
Communicating using "port" - Archive of obsolete content
by supplying a target for this function in the page-mod's constructor you can register to receive messages from the content script, and take a reference to the worker so as to emit messages to the content script.
... from the content script to the main add-on code: var mymessagepayload = "some data"; self.port.emit("mymessage", mymessagepayload); from the main add-on code (in this case a panel instance) to the content script: var mymessagepayload = "some data"; panel.port.emit("mymessage", mymessagepayload); port.on() the port.on() function registers a function as a listener for a specific named message sent from the other side using port.emit().
Working with Events - Archive of obsolete content
by registering a listener function to an event emitter an add-on can receive notifications of these events.
... for example, the following add-on registers a listener with the tabs module to listen for the ready event, and logs a string to the console reporting the event: var tabs = require("sdk/tabs"); tabs.on("ready", function () { console.log("tab loaded"); }); it is not possible to enumerate the set of listeners for a given event.
XUL Migration Guide - Archive of obsolete content
my-addon/ chrome/ content/ locale/ skin/ chrome.manifest data/ lib/ package.json there are limitations on what you can do in this manifest file: for example, you can't register overlays, resource: uris, or components.
... however, you can register a chrome: uri, with a skin and locale, and this means you can include xul windows in an sdk-based add-on.
simple-prefs - Archive of obsolete content
globals functions on(prefname, listener) registers an event listener that will be called when a preference is changed.
... removelistener(prefname, listener) unregisters an event listener for the specified preference.
remote/child - Archive of obsolete content
removeeventlistener removes an event listener that was previously registered.
... removeeventlistener(event, listener, iscapturing) removes an event listener that was previously registered.
Finding window handles - Archive of obsolete content
interface(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/reference/applicationkit/classes/nsapplication_class/index.html#//apple_ref/occ/instp/nsapplication/orderfront: * [nswindowptr orderfront:nil] */ var orderfront...
... = sel_registername('orderfront:'); var nswindowptr = ctypes.voidptr_t(ctypes.uint64(nswindowstring)); var rez_orderfront = objc_msgsend(nswindowptr, orderfront, nil); console.log('rez_orderfront:', rez_orderfront, rez_orderfront.tostring()); objc.close(); unix under unix systems, the nativehandle holds a string address to a gdkwindow* (the asterik/star means pointer).
Extension Packaging - Archive of obsolete content
after the extension files and install.rdf have been prepared, there are several ways to prepare an extension for installation: zip the extension directory into a user-installable xpi (xpinstall) file, unpack the extension directly into the user's application or profile directory, or register the extension in the windows registry.
... register an extension location using the windows registry external installers, such as the java runtime, may wish to install application integration points as an extension, even if the application is not yet installed.
Listening to events in Firefox extensions - Archive of obsolete content
simple dom events registering for a dom event is done using with code such as the following: function callback(evt) { // do your processing here.
... the internal listeners are used to send out progress events to listeners registered with addprogresslistener() (which receives events from the browser that is currently visible) and addtabsprogresslistener() (which receives events from all browsers).
Intercepting Page Loads - Archive of obsolete content
we register and unregister the progress listeners for the first tab manually, and then add tab open and close event listeners so we can keep track of the rest of the listeners for all the tabs.
...you can create an xpcom component that extends nsicontentpolicy and register it to the "content-policy" category using the nsicategorymanager.
Search Extension Tutorial (Draft) - Archive of obsolete content
if (engine && engine.getsubmission("_searchterms_").uri.spec == engine_details.url) services.search.removeengine(engine); } } function install() {} function uninstall() {} the complex method requires two files, an xml search description file and a javascript file to register the engine.
... let engine = services.search.getenginebyname(engine_details.name); if (engine) searchobserver(engine, engine_details); else { // register an observer to detect when the engine has been added, if // necessary.
Adding preferences to an extension - Archive of obsolete content
var stockwatcher = { prefs: null, tickersymbol: "", // initialize the extension startup: function() { // register to receive notifications of preference changes this.prefs = components.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefservice) .getbranch("extensions.stockwatcher2."); this.prefs.addobserver("", this, false); this.tickersymbol = this.prefs.getcharpref("symbol").touppercase(); this.refreshinformation(); window.se...
... the next step is to register a preference observer by calling the addobserver() method to establish that whenever any events occur on the preferences, our object (this) receives notification.
Creating a status bar extension - Archive of obsolete content
content status-bar-sample-1 chrome/content/ # firefox overlay chrome://browser/content/browser.xul chrome://status-bar-sample-1/content/status-bar-sample-1.xul the first line registers the location on disk of the contents of the extension whose id is "status-bar-sample-1".
...the second line registers an overlay.
Install.js - Archive of obsolete content
' + this.extversion; var regname = '/' + this.extauthor + '/' + this.extshortname; install.initinstall(dispname, regname, this.extversion); // find directory to install into var installpath; if (this.profileinstall) installpath = profiledir; else installpath = install.getfolder('chrome'); // add jar file install.addfile(null, 'chrome/' + jarname, installpath, null); // register chrome var jarpath = install.getfolder(installpath, jarname); var installtype = this.profileinstall ?
... install.profile_chrome : install.delayed_chrome; // register content install.registerchrome(install.content | installtype, jarpath, 'content/' + this.extshortname + '/'); // register locales for (var locale in this.extlocalenames) { var regpath = 'locale/' + this.extlocalenames[locale] + '/' + this.extshortname + '/'; install.registerchrome(install.locale | installtype, jarpath, regpath); } // register skins for (var skin in this.extskinnames) { var regpath = 'skin/' + this.extskinnames[skin] + '/' + this.extshortname + '/'; install.registerchrome(install.skin | installtype, jarpath, regpath); } // perform install var err = install.performinstall(); if (err == install.success || err == install.reboot_needed) { if (!this.silentinstall && this.
MMgc - Archive of obsolete content
we basically ignore the stack and registers.
...the way it works is that all gc roots are registered with the gc library and it can mark everything by traversing the roots.
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
build it it is quite simple to build the control locate the pluginhostctrl directory: open pluginhostctrl.dsp build "win32 debug" or another target open some of the test files under pluginhostctrl\tests in internet explorer to verify the control has built and registered correctly.
... manual installation assuming you have the precompiled pluginhostctrl.dll and wish to install it on a machine, you must register it either through an install script or manually: regsvr32 pluginhostctrl.dll you must have administrator privileges to install a new control on operating systems such as windows nt, 2000 & xp.
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
if your code cannot find the gre and keeps throwing filenotfoundexceptions during the getgrepathwithproperties(...) call, check whether you already registered the gre on your system: gre registration the initembedding method kicks off the embedding process, allowing the java application to work with xpcom and mozilla.
...servicemanager servicemanager = mozilla.getservicemanager(); nsiwindowwatcher windowwatcher = (nsiwindowwatcher) servicemanager .getservicebycontractid(ns_windowwatcher_contractid, nsiwindowwatcher.ns_iwindowwatcher_iid); windowwatcher.setwindowcreator(creator); in this example, we have a java class called windowcreator, which implements the nsiwindowcreator interface, and we want to register it with mozilla.
GRE - Archive of obsolete content
to understand how gres are registered, see gre registration.
...there was never an official gre shipped for linux, but various distributors such as red hat have registered mozilla installations as if they were a gre.
First run - Archive of obsolete content
you can also register a callback that will be called after installation.
... </p> </> }; in this example, the page at http://example.com/myjetpack becomes the first-run page: var manifest = { firstrunpage: "http://example.com/myjetpack" }; first-run callback you can register a callback that will be called after your jetpack has been successfully installed.
First Run - Archive of obsolete content
you can also register a callback that will be called after installation.
... </p> </> }; in this example, the page at [http://example.com/myjetpack] becomes the first-run page: var manifest = { firstrunpage: "http://example.com/myjetpack" }; first-run callback you can register a callback that will be called after your jetpack has been successfully installed.
Mozilla Application Framework in Detail - Archive of obsolete content
the xpinstall api makes the following functionality available as high-level javascript objects: an install trigger that initiates installations windows registry access mozilla registration interfaces for registering new mozilla software facilities for detecting and maintaining application versions high-level objects for manipulating local directories and files complete reference documentation, including useful example installations the following snippet from an xpinstall installation gives you some idea about how easy it is to write cross-platform installations that use the mozilla browser: // regist...
...er chrome registerchrome(package | delayed_chrome, getfolder("chrome","xmlterm.jar"), "content/xmlterm/"); registerchrome(skin | delayed_chrome, getfolder("chrome","xmlterm.jar"), "skin/modern/xmlterm/"); registerchrome(locale | delayed_chrome, getfolder("chrome","xmlterm.jar"), "locale/xmlterm/"); if (getlasterror() == success) performinstall(); else { alert("error detected: "+getlasterror()); cancelinstall(); } other features a resource description framework (rdf) parser with support for creating rdf graphs programmatically or by parsing files, compositing multiple sources into a single rdf graph, querying and manipulating graphs, and populating xul widgets (trees, menus, etc.) with graph data; an xslt/xpath processor; scalable vector graphics (svg) rendering with support for a us...
Standalone XPCOM - Archive of obsolete content
nsnativecomponentloader: autoregistering begins.
... nsnativecomponentloader: autoregistering succeeded inital print: initial value set value to: xpcom defies gravity final print : xpcom defies gravity test passed.
Supporting private browsing mode - Archive of obsolete content
a private browser listener helper object this helper object registers listeners for private browsing mode changes.
... it will simply always report that private browsing is off, and will never call any registered watcher functions.
Event Handlers - Archive of obsolete content
(note that there is a possibility that this may change in the future.) handlers are attached to the bound element, and they are registered by default for bubbling events.
... the phase attribute specifies the phase of event flow that the handler is registered for.
refreshPlugins - Archive of obsolete content
refreshplugins refreshes the list of plug-ins registered for the browser.
...description refreshplugins lets you register new plug-ins without having to restart the browser.
XPInstall API reference - Archive of obsolete content
objects install properties methods adddirectory addfile alert cancelinstall confirm deleteregisteredfile execute gestalt getcomponentfolder getfolder getlasterror getwinprofile getwinregistry initinstall loadresources logcomment patch performinstall refreshplugins registerchrome reseterror setpackagefolder installtrigger no properties methods ...
...tostring file no properties methods copy dircreate dirgetparent dirremove dirrename diskspaceavailable execute exists isdirectory isfile macalias moddate moddatechanged move remove rename size windowsgetshortname windowsregisterserver windowsshortcut winprofile no properties methods getstring writestring winreg no properties methods createkey deletekey deletevalue enumkeys enumvaluenames getvalue getvaluenumber getvaluestring iskeywritable keyexists setroo...
Index - Archive of obsolete content
ArchiveMozillaXULIndex
custom query processors are xpcom components, must implement the nsixultemplatequeryprocessor interface and follow some conventions for when registering the component.
... 890 providing command-line options add-ons, command line, extensions, guide, xulrunner extensions and xul applications can modify the way command line parameters are handled by writing a component that implements the nsicommandlinehandler interface and registering it in a category.
Using the standard theme - Archive of obsolete content
if you are only going to use these global style sheets, you of course do not need a <tt>skin</tt> directory in your extension package, and also do not have to register a style in the <tt>chrome.manifest</tt>.
...no matter which approach you choose, do not forget to register your custom skin in the <tt>chrome.manifest</tt>.
Components - Archive of obsolete content
adding components to xulrunner is simple once you understand how xulrunner registers and saves the components.
...then you need to make sure that it gets registered.
Sunbird Theme Tutorial - Archive of obsolete content
making a theme a theme consists of: a unique identifier a file containing information about the theme a file that registers the theme with sunbird some files containing the theme itself set up your theme in sunbird's profile directory.
... registering your theme to register your theme, create a plain text file named <tt>chrome.manifest</tt>.
RDF in Mozilla FAQ - Archive of obsolete content
note that the w3c rdf core wg are registering application/rdf+xml, though this isn't understood by any mozilla code yet.
... (do we have a bug registered to track this?
Domain - MDN Web Docs Glossary: Definitions of Web-related terms
they are registered as an internet standard by the iana .
...if you like to own a domain you have to register it with one of the many registrars who are allowed to do so with a top-level domain registry.
Introducing asynchronous JavaScript - Learn web development
it worked :) if this confuses you, then consider the following smaller example: console.log("registering click handler"); button.addeventlistener('click', () => { console.log("get click"); }); console.log("all done"); this is very similar in behavior — the first and third console.log() messages will be shown immediately, but the second one is blocked from running until someone clicks the mouse button.
...but web browsers define functions and apis that allow us to register functions that should not be executed synchronously, and should instead be invoked asynchronously when some kind of event occurs (the passage of time, the user's interaction with the mouse, or the arrival of data over the network, for example).
Properly configuring server MIME types - Learn web development
examples of mime types are: text/html for normal web pages text/plain for plain text text/css for cascading style sheets text/javascript for scripts application/octet-stream meaning "download this file" application/x-java-applet for java applets application/pdf for pdf documents technical background registered values for mime types are available in iana | mime media types.
... look in the iana | mime media types registry which contains all registered mime types.
Getting started with React - Learn web development
this file is the entry point for our app, and it initially looks like this: import react from 'react'; import reactdom from 'react-dom'; import './index.css'; import app from './app'; import * as serviceworker from './serviceworker'; reactdom.render(<app />, document.getelementbyid('root')); // if you want your app to work offline and load faster, you can change // unregister() to register() below.
...// learn more about service workers: https://bit.ly/cra-pwa serviceworker.unregister(); as with app.js, the file starts by importing all the js modules and other assets it needs to run.
Deployment and next steps - Learn web development
register for an account with vercel.
... first you'll have to register at gitlab and then create a new project.
Creating Sandboxed HTTP Connections
since the observers get notified for the registered topic for any connection, the listener needs to make sure that the notification is for the http connection our code created.
... } } }, queryinterface : function(aiid) { if (aiid.equals(components.interfaces.nsisupports) || aiid.equals(components.interfaces.nsiobserver)) return this; throw components.results.ns_nointerface; } }; // get the observer service and register for the two coookie topics.
Adding APIs to the navigator object
each method below of adding new objects to the navigator object requires that the new object is a registered xpcom component.
... you can read about creating and registering xpcom components in javascript.
Error codes returned by Mozilla APIs
ns_error_factory_not_registered (0x80040154) returned when a service could not be found.
... ns_error_factory_register_again (0x80040155) this error is returned when registering a component and the registration should try registering again later.
Communicating with frame scripts
ge-manager-disconnect to update the array when the message managers disconnect (for example because the user closed the tab): function myobserver() { } myobserver.prototype = { observe: function(subject, topic, data) { var index = messagemanagers.indexof(subject); if (index != -1) { console.log("one of our message managers disconnected"); mms.splice(index, 1); } }, register: function() { var observerservice = cc["@mozilla.org/observer-service;1"] .getservice(ci.nsiobserverservice); observerservice.addobserver(this, "message-manager-disconnect", false); console.log("listening"); }, unregister: function() { var observerservice = cc["@mozilla.org/observer-service;1"] .getservice(ci.nsiobserverser...
...vice); observerservice.removeobserver(this, "message-manager-disconnect"); } } var observer = new myobserver(); observer.register(); ...
Message manager overview
process scripts are most likely to be useful when an extension wants to run some code only once in the content process, to access some global service: for example, to register an observer or a content policy.
...this is the recommended way to load a script that executes just once per child process, which is something you might want to do if you are interacting with some global service (for example, adding listeners to observer notifications or registering a content policy).
How Mozilla determines MIME Types
if that also failed, the list of loaded plugins is checked for a plugin that can handle this extension, and is asked for the mime type if no plugin is registered, the ext-to-type-mapping xpcom category is searched for the extension.
... this allows extensions to register additional mappings.
IME handling guide
when an instance is created, it's registered to the list.
... when composition completely ends, it's unregistered from the list (and released automatically).
Internationalized Domain Names (IDN) Support in Mozilla Browsers
rfc's 3490, 3491, 3492.) these new rfc's now make it possible for domain name servers to register non-ascii domain names and application/client vendors to implement standardized support for handling non-ascii characters in domain names.
...many web sites around the world are expected to register native language host names with the appropriate domain name registrars for their top domains.
Introduction to Layout in Mozilla
may not be directly manipulated detailed walk-through setting up content model construction frame construction style resolution reflow painting setting up assume basic knowledge of embedding and network apis (doc shell, streams) content dll auto-registers a document loader factory (dlf) @mozilla.org/content-viewer-factory/view;1?type=text/html all mime types mapped to the same class, nscontentdlf nsdocshell receives inbound content via nsdsuricontentlistener invokes nsidlf::createinstance, passes mime type to dlf nscontentdlf creates a nshtmldocument object, invokes startdocumentload.
...reates and attaches content nodes using nsicontent interface content sink maintains stack of “live” elements more buffering and fixup occurs here insertchildat, appendchildto, removechildat frame construction content sink uses nsidocument interface to notify of Δs in content model contentappended, contentinserted, contentremoved presshell is registered as document observer receives contentappended, etc.
WebChannel.jsm
method overview listen(function callback); stoplistening(); send(object message, eventtarget target); attributes id string webchannel id methods listen() registers the callback for messages on this channel.
... registers the channel itself with the webchannelbroker.
Mozilla Content Localized in Your Language
tone/register what is the appropriate tone for your translations?
... add style :: register, variants/slang, awkward, company style (branding guidelines), inconsistent style, third-party style, unidiomatic (steps to define your approach to culture-specific & locale-specific references) ...
PR_NewThreadPrivateIndex
when you allocate the index, you may also register a destructor function of type prthreadprivatedtor.
... if a destructor function is registered with a new index, it will be called at one of two times, as long as the private data is not null: when replacement private data is set with pr_setthreadprivate when a thread exits the index maintains independent data values for each binding thread.
PR_SetLibraryPath
registers a default library pathname with a runtime.
...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.
NSS 3.12.4 release notes
a on macosx bug 498511: produce debuggable optimized nss builds for mozilla on linux bug 499385: drbg reseed function needs to be tested on post bug 499825: utilrename.h is missing from solaris packages bug 502961: allocator mismatch in pk11mode bug 502965: allocator mismatch in sdrtest bug 502972: another allocator mismatch in sdrtest bug 504398: pkix_pl_aiamgr_gethttpcerts could crash if sec_getregisteredhttpclient fails bug 504405: pkix_pl_crldp_create will fail on alloc success because of a missing !
...bug 505858: nss_registershutdown can return without unlocking nssshutdownlist.lock bug 507041: invalid build options for vc6 bug 507228: coreconf.dep doesn't need to contain the nss version number bug 507422: crash [[@ port_freearena - lg_mksecretkeyrep] when port_newarena fails bug 507482: nss 3.12.3 (and later) doesn't build on aix 5.1 bug 507937: pwdecrypt program problems bug 508259: pk11mode crashed on linux2.4 bug 508467: libpki...
Rhino optimization
simple data and type flow analysis is performed to determine which javascript variables can be allocated to java vm registers, and which variables are used only as numbers.
...all local variables and parameters are allocated to java vm registers.
GC Rooting Guide
what will happen is that the return statement will pull the bare jsobject* out of the rooted obj variable and either put it in the stack or store it in the return value register.
... then ~eventlogger will fire and trigger a gc, invalidating that unrooted stack/register pointer.
Hacking Tips
$ valgrind --smc-check=all-non-file --vex-iropt-register-updates=allregs-at-mem-access --vgdb-error=0 ./js … this command will tell you how to start gdb as a remote.
... $ valgrind --tool=callgrind --callgrind-out-file=bench.clg \ --smc-check=all-non-file --vex-iropt-register-updates=allregs-at-mem-access ./js ./run.js the output file can then be use with kcachegrind which provides a graphical view of the call graph.
Index
432 js_removerootrt jsapi reference, obsolete, spidermonkey unregisters a pointer to a gc thing so that it is no longer a member of the garbage collector's root set.
...js_seterrorreporter 456 js_setextragcroots jsapi reference, spidermonkey register externally maintained gc roots.
JS_RemoveRootRT
unregisters a pointer to a gc thing so that it is no longer a member of the garbage collector's root set.
...syntax jsbool js_removerootrt(jsruntime *rt, void *rp); name type description rt jsruntime * pointer to the runtime with which the root was registered.
SpiderMonkey 1.8.5
unlike the exact garbage collector, the new garbage collector will scan the c stack and registers in your embedding, looking for bits that it can treat as potential gc roots.
...bug 614138 introduces a c++ js::anchor<> template class to help tie lexical scope to the conservative gc for cases where the compiler might optimize away important stack/register roots (such as when we access the jschars in a jsstring).
SpiderMonkey 1.8.7
unlike the exact garbage collector, the new garbage collector will scan the c stack and registers in your embedding, looking for bits that it can treat as potential gc roots.
...bug 614138 introduces a c++ js::anchor<> template class to help tie lexical scope to the conservative gc for cases where the compiler might optimize away important stack/register roots (such as when we access the jschars in a jsstring).
Bundling multiple binary components
the stub component is an xpcom component itself and when registered by xpcom, the code would sniff the runtime version and operating system then the stub load the appropriate "real" xpcom component for the current configuration.
... the real components are manually loaded and registered using the stub ("krealcomponent" in the sample).
Building the WebLock UI
once it's installed and registered, the weblock component itself is ready to go: xpcom finds it and adds it to the list of registered components, and then weblock observes the xpcom startup event and initializes itself.
...overlays are xul files that register themselves to be dynamically inserted into the appropriate parts of the browser ui at runtime.
Creating XPCOM components
for example, the introduction includes a discussion of components and what they are, and the first chapter - in which you compile the basic code and register it with mozilla - prompts a discussion of the relationship between components and modules, of xpcom interfaces, and of the registration process in general.
...the registration methods creating an instance of your component weblock1.cpp using xpcom utilities to make things easier xpcom macros generic xpcom module macros common implementation macros declaration macros weblock2.cpp string classes in xpcom using strings nsembedstring and nsembedcstring smart pointers starting weblock getting called at startup registering for notifications getting access to the category manager providing access to weblock creating the weblock programming interface defining the weblock interface in xpidl the xpidl syntax scriptable interfaces subclassing nsisupports the web locking interface implementing weblock declaration macros representing return values in xpcom xpidl code generation getting...
HOWTO
oadsubscript("chrome://myall/content/file.jsm"); see: http://mxr.mozilla.org/comm-central/...figutils.js#54 solution 2 append the following at the top of your js file which you want to run in xpcshell { // <https://developer.mozilla.org/en/xpconnect/xpcshell/howto> // <https://bugzilla.mozilla.org/show_bug.cgi?id=546628> let cc = components.classes; let ci = components.interfaces; // register resource://app/ uri let ios = cc["@mozilla.org/network/io-service;1"] .getservice(ci.nsiioservice); let reshandler = ios.getprotocolhandler("resource") .queryinterface(ci.nsiresprotocolhandler); let mozdir = cc["@mozilla.org/file/directory_service;1"] .getservice(ci.nsiproperties) .get("curprocd", ci.nsilocalfile); let mozdiruri = ios.newfileuri(mozdir); reshandler...
....setsubstitution("app", mozdiruri); // register chrome://* uris let cr = cc["@mozilla.org/chrome/chrome-registry;1"] .getservice(ci.nsichromeregistry); cr.checkfornewchrome(); } bug 546628 would make this unnecessary.
nsIDispatchSupport
classexists returns containing pr_false if the class is not registered.
...boolean isclasssafetohost( in jscontextptr cx, in nscidref cid, in boolean capscheck, out boolean classexists ); parameters cx cid capscheck classexists returns containing pr_false if the class is not registered.
nsIDragDropHandler
use this to register where the listeners should attach (something that implements nspidomeventtarget which is what we end up using under the hood).
... last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void detach(); void hookupto(in nsidomeventtarget attachpoint, in nsiwebnavigation navigator); methods detach() unregisters all handlers related to drag and drop.
nsIHttpHeaderVisitor
isitor.prototype.visitheader = function ( aheader, avalue ) { if ( aheader.indexof( "content-type" ) !== -1 ) { if ( avalue.indexof( "application/x-shockwave-flash" ) !== -1 ) { this._isflash = true; } } }; mynsihttpheadervisitor.prototype.isflash = function ( ) { return this._isflash; }; myhttprequestobserver = function ( ) { this.register( ); this.aborted = components.results.ns_binding_aborted; this.nsihttpchannel = components.interfaces.nsihttpchannel; this.nsichannel = components.interfaces.nsichannel; this.nsirequest = components.interfaces.nsirequest; }; myhttprequestobserver.prototype.observe = function ( subject, topic, data ) { var uri, avisitor; if ( subject instanceof th...
...is.nsihttpchannel ) { avisitor = new mynsihttpheadervisitor( ); subject.visitresponseheaders( avisitor ); if ( avisitor.isflash( ) ) { uri = subject.uri; subject.cancel( this.aborted ); alert( "found flash!" ); //handle flash file here } } }; myhttprequestobserver.prototype.register = function ( ) { var observerservice = components.classes[ "@mozilla.org/observer-service;1" ].getservice( components.interfaces.nsiobserverservice ); observerservice.addobserver(this, "http-on-examine-response", false); observerservice.addobserver(this, "http-on-examine-cached-response", false); }; myhttprequestobserver.prototype.unregister = function ( ) { var observerservice = c...
nsIIdleService
1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 16 (firefox 16 / thunderbird 16 / seamonkey 2.13) you can get the idle time directly, but in most cases you will want to register an observer for a predefined interval.
... removeidleobserver() remove an observer registered with addidleobserver().
nsIMessageListenerManager
messagelistener(in astring messagename, in nsimessagelistener listener); void addweakmessagelistener(in astring messagename, in nsimessagelistener listener); void removeweakmessagelistener(in astring messagename, in nsimessagelistener listener); methods addmessagelistener() register listener to receive messagename.
...if the same listener registers twice for the same message, the second registration is ignored.
nsIPermissionManager
this must have been previously registered using the add() method.
...this must have been previously registered using the add() method.
nsIServiceManager
exceptions thrown ns_error_factory_not_registered indicates that the specified class is not registered.
... exceptions thrown ns_error_factory_not_registered indicates that the specified class is not registered.
nsIStreamConverter
stream converter suppliers registering a stream converter: stream converter registration is a two step process.
... first of all the stream converter implementation must register itself with the component manager using a contractid in the format below.
nsIWinTaskbar
an application can register its own "tab" previews.
... defaultgroupid astring the default application user model id the application registers with the system.
XPCOM
unless otherwise noted you register for the topics using the nsiobserverservice.setting http request headershttp is one of the core technologies behind the web.
... troubleshooting xpcom components registrationoften the first time you create an xpcom component, it may fail to register correctly.using nscomptrthis document is the sum total of everything written down about nscomptr.
Filelink Providers
the nsimsgcloudfileprovider implementation must be registered as a component.
... if the nsimsgcloudfileprovider is being created as part of an add-on, the add-on must register the component in chrome.manifest.
Index
you can do many things with the window object, such as accessing the height or width of the window/tab or setting its title, registering timer events and much more.
... 102 detect opening folder thunderbird some actions require execution every time you open a folder (for example, registering a custom column handler.
Access Window
you can do many things with the window object, such as accessing the height or width of the window/tab or setting its title, registering timer events and much more.
... register a timer window.setinterval( function() { alert('foobar'); }, 60000); //execute the function once very minute if you periodically need to perform a certain action then you can use the setinterval function, it will then call this function every x milliseconds, in this case every 60000ms or one minute.
Initialization and Destruction - Plugins
during initialization, 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.
AudioParamDescriptor - Web APIs
first, we need to define a custom audioworkletprocessor, and register it.
... } }) return true } } registerprocessor('white-noise-processor', whitenoiseprocessor) next, in our main scripts file we'll load the processor, create an instance of audioworkletnode passing it the name of the processor, and connect the node to an audio graph.
AudioWorkletNode.parameters - Web APIs
first, we need to define a custom audioworkletprocessor, and register it.
... } }) return true } } registerprocessor('white-noise-processor', whitenoiseprocessor) next, in our main scripts file we'll load the processor, create an instance of audioworkletnode passing it the name of the processor, and connect the node to an audio graph.
AudioWorkletNode.port - Web APIs
first, we need to define a custom audioworkletprocessor, and register it.
... // ping-pong-processor.js class pingpongprocessor extends audioworkletprocessor { constructor (...args) { super(...args) this.port.onmessage = (e) => { console.log(e.data) this.port.postmessage('pong') } } process (inputs, outputs, parameters) { return true } } registerprocessor('ping-pong-processor', pingpongprocessor) now in our main scripts file we'll load the processor, create an instance of audioworkletnode passing the name of the processor, and connect the node to an audio graph.
AudioWorkletNode - Web APIs
first, we need to define a custom audioworkletprocessor, which will output white noise, and register it.
... // white-noise-processor.js class whitenoiseprocessor extends audioworkletprocessor { process (inputs, outputs, parameters) { const output = outputs[0] output.foreach(channel => { for (let i = 0; i < channel.length; i++) { channel[i] = math.random() * 2 - 1 } }) return true } } registerprocessor('white-noise-processor', whitenoiseprocessor) next, in our main script file we'll load the processor, create an instance of audioworkletnode passing it the name of the processor, and connect the node to an audio graph.
AudioWorkletProcessor() - Web APIs
first, we need to define a custom audioworkletprocessor and register it.
... // test-processor.js class testprocessor extends audioworkletprocessor { constructor (options) { super() console.log(options.numberofinputs) console.log(options.processoroptions.someusefulvariable) } process (inputs, outputs, parameters) { return true } } registerprocessor('test-processor', testprocessor) next, in our main script file we'll load the processor, create an instance of audioworkletnode passing it the name of the processor and options object.
AudioWorkletProcessor.parameterDescriptors (static getter) - Web APIs
first, we need to define a custom audioworkletprocessor, and register it.
... } }) return true } } registerprocessor('white-noise-processor', whitenoiseprocessor) next, in our main scripts file we'll load the processor, create an instance of audioworkletnode passing it the name of the processor, and connect the node to an audio graph.
AudioWorkletProcessor.port - Web APIs
first, we need to define a custom audioworkletprocessor, and register it.
... // ping-pong-processor.js class pingpongprocessor extends audioworkletprocessor { constructor (...args) { super(...args) this.port.onmessage = (e) => { console.log(e.data) this.port.postmessage('pong') } } process (inputs, outputs, parameters) { return true } } registerprocessor('ping-pong-processor', pingpongprocessor) now in our main scripts file we'll load the processor, create an instance of audioworkletnode passing the name of the processor, and connect the node to an audio graph.
CSS Painting API - Web APIs
examples to draw directly into an element's background using javascript in our css, we define a paint worklet using the registerpaint() function, tell the document to include the worklet using the paintworklet addmodule() method, then include the image we created using the css paint() function.
... we create our paintworklet called 'hollowhighlights' using the registerpaint() function: registerpaint('hollowhighlights', class { static get inputproperties() { return ['--boxcolor']; } static get inputarguments() { return ['*','<length>']; } static get contextoptions() { return {alpha: true}; } paint(ctx, size, props, args) { const x = 0; const y = size.height * 0.3; const blockwidth = size.width * 0.33; const blockheight = size.height * 0.85; const thecolor = props.get( '--boxcolor' ); const stroketype = args[0].tostring(); const strokewidth = parseint(args[1]); console.log(thecolor); if ( strokewidth ) { ctx.linewidth = strokewidth; } else { ctx.linewidth = 1.0; } if ( stroketype === 'stroke' ) { ctx.fillstyle = 'transparent'; ctx.stroke...
Using channel messaging - Web APIs
when the iframe has loaded, we register an onclick handler for our button and an onmessage handler for messagechannel.port1.
...this saves the transferred port and register an onmessage handler that will be called each time a message is passed through our messagechannel.
ContentIndex.delete() - Web APIs
the delete() method of the contentindex interface unregisters an item from the currently indexed content.
... async function unregistercontent(article) { // reference registration const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) return; // unregister content from index await registration.index.delete(article.id); } the delete method can also be used within the service worker scope.
Frame Timing API - Web APIs
an application can register a performanceobserver for "frame" performance entry types.
... frame observers the performance observer interfaces allow an application to register an observer for specific performance event types.
Using the MediaStream Recording API - Web APIs
we register an event handler to do this using mediarecorder.ondataavailable: let chunks = []; mediarecorder.ondataavailable = function(e) { chunks.push(e.data); } note: the browser will fire dataavailable events as needed, but if you want to intervene you can also include a timeslice when invoking the start() method — for example start(10000) — to control this interval, or call mediarecorder.reques...
...we register an event handler for this using mediarecorder.onstop, and finalize our blob there from all the chunks we have received: mediarecorder.onstop = function(e) { console.log("recorder stopped"); const clipname = prompt('enter a name for your sound clip'); const clipcontainer = document.createelement('article'); const cliplabel = document.createelement('p'); const audio = document.createel...
Navigator.msLaunchUri() - Web APIs
if the user's system does not have a program registered to handle a specific protocol, and a nohandlercallback is provided, windows internet explorer will invoke the nohandlercallback.
...if multiple programs are registered on the system for the given protocol and no default has been chosen, windows prompts the user to choose one.
Payment processing concepts - Web APIs
standardized payment method identifiers there is currently only one registered standardized payment method identifier (more may be added in the future): basic-card payments are handled by the basic card payment specification.
... payment method identifiers candidate recommendation defines payment method identifiers and how they are validated, and, where applicable, minted and formally registered with the w3c.
Payment Request API - Web APIs
merchantvalidationevent represents the browser requiring the merchant (website) to validate themselves as allowed to use a particular payment handler (e.g., registered as allowed to use apple pay).
... basic card payment working draft defines basiccardrequest and basiccardresponse, among other things needed for handling credit card payment payment method identifiers candidate recommendation defines payment method identifiers and how they are validated, and, where applicable, minted and formally registered with the w3c.
Using Performance Timeline - Web APIs
var pelist = performance.getentries(); var pe = pelist[0]; if (pe.tojson === undefined) { log ("performanceentry.tojson() is not supported"); return; } // print the performanceentry object var json = pe.tojson(); var s = json.stringify(json); log("performanceentry.tojson = " + s); } performance observers the performance observer interfaces allow an application to register an observer for specific performance event types, and when one of those event types is recorded, the application is notified of the event via the observer's callback function that was specified at the time, the observer was created.
... the following example shows how to register two observers: the first one registers for several event types and the second observer only registers for one event type.
Performance Timeline - Web APIs
performance observers the performance observer interfaces allow an application to register an observer for specific performance event types, and when one of those event types is recorded, the application is notified of the event via the observer's callback function that was specified when the observer was created.
... besides the performanceobserver's interface's observe() method (which is used to register the entry types to observe), the performanceobserver interface also has a disconnect() method that stops an observer from receiving further events.
PushManager.registrations() - Web APIs
} else { // register for a new endpoint.
... var register = navigator.push.register(); register.onsuccess = function(e) { console.log("registered new endpoint", register.result); } } } specification specification status comment push api working draft defines the pushmanager interface.
ServiceWorkerGlobalScope - Web APIs
once successfully registered, a service worker can and will be terminated when idle to conserve memory and processor power.
... sync triggered when a call to syncmanager.register is made from a service worker client page.
SyncManager - Web APIs
the syncmanager interface of the the serviceworker api provides an interface for registering and listing sync registrations.
... methods syncmanager.register create a new sync registration and return a promise.
Using Touch Events - Web APIs
register an event handler for each touch event type.
... // register touch event handlers someelement.addeventlistener('touchstart', process_touchstart, false); someelement.addeventlistener('touchmove', process_touchmove, false); someelement.addeventlistener('touchcancel', process_touchcancel, false); someelement.addeventlistener('touchend', process_touchend, false); process an event in an event handler, implementing the application's gesture semantics.
Window.customElements - Web APIs
the customelements read-only property of the window interface returns a reference to the customelementregistry object, which can be used to register new custom elements and get information about previously registered custom elements.
... examples the most common example you'll see of this property being used is to get access to the customelementregistry.define() method to define and register a new custom element, e.g.: let customelementregistry = window.customelements; customelementregistry.define('my-custom-element', mycustomelement); however, it is usually shortened to something like the following: customelements.define('element-details', class extends htmlelement { constructor() { super(); const template = document .getelementbyid('element-details-template') .content; const shadowroot = this.attachshadow({mode: 'open'}) .appendchild(template.clonenode(true)); } } ); see our web-components-examples repo for more usage examples.
Window: resize event - Web APIs
bubbles no cancelable no interface uievent event handler property onresize in some earlier browsers it was possible to register resize event handlers on any html element.
...only handlers registered on the window object will receive resize events.
Overview of events and handlers - Developer guides
the pattern is implemented by defining a javascript function which takes as an argument the data structure which was agreed upon, and registering the function using the name string with the object which will emit the event.
..."eventprototype" : "objectprototype"; alert("we got a click event at " + ev.timestamp + " with an argument object derived from: " + objkind ); }; and second register our function with the the button object, either on the scripting side using the dom (document object model) representation of the html page: var buttondomelement = document.queryselector('#buttonone'); buttondomelement.addeventlistener('click', example_click_handler); or within the html page by adding the function as the value of the 'onclick' attribute, although this second approach is usually...
<a>: The Anchor element - HTML: Hypertext Markup Language
WebHTMLElementa
links are not restricted to http-based urls — they can use any url scheme supported by browsers: sections of a page with fragment urls pieces of media files with media fragments telephone numbers with tel: urls email addresses with mailto: urls while web browsers may not support other url schemes, web sites can with registerprotocolhandler() hreflang hints at the human language of the linked url.
... websites can make phone calls with registerprotocolhandler, such as web.skype.com.
Clear-Site-Data - HTTP
this affects the entire registered domain, including subdomains.
...this includes storage mechanisms such as: localstorage (executes localstorage.clear), sessionstorage (executes sessionstorage.clear), indexeddb (for each database execute idbfactory.deletedatabase), service worker registrations (for each service worker registration, execute serviceworkerregistration.unregister), appcache, websql databases, filesystem api data, plugin data (flash via npp_clearsitedata).
Add to Home screen - Progressive web apps (PWAs)
chrome additionally requires the app to have a service worker registered (e.g., so it can function when offline).
...the service worker is registered against the site with the final code block in the index.js file.
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
registering the service worker we'll start by looking at the code that registers a new service worker, in the app.js file: note : we're using the es6 arrow functions syntax in the service worker implementation if('serviceworker' in navigator) { navigator.serviceworker.register('./pwa-examples/js13kpwa/sw.js'); }; if the service worker api is supported in the browser, it is registered against the s...
...ite using the serviceworkercontainer.register() method.
Cross-domain Content Scripts - Archive of obsolete content
if you want to try it out, you'll need to register and get an api key.
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.
port - Archive of obsolete content
from the content script to the main add-on code: // content-script.js var mymessagepayload = "some data"; self.port.emit("mymessage", mymessagepayload); from the main add-on code to the content script: // main.js var mymessagepayload = "some data"; worker.port.emit("mymessage", mymessagepayload); on() the port.on() function registers a function as a listener for a particular message sent from the other side using port.emit().
context-menu - Archive of obsolete content
if you register a listener function for this event and it returns true, the menu item associated with the listener's content script is shown in the menu.
page-mod - Archive of obsolete content
modifications already made to open documents by content scripts will not be undone, but stylesheets added by contentstyle or contentstylefile, will be unregistered immediately.
request - Archive of obsolete content
registered event listeners are passed a response object.
selection - Archive of obsolete content
usage registering for selection notifications to be notified when the user makes a selection, register a listener for the "select" event.
simple-storage - Archive of obsolete content
to listen for quota notifications, register a listener for the "overquota" event.
url - Archive of obsolete content
gettld(url) returns the top-level domain for the given url: that is, the highest-level domain under which individual domains may be registered.
system/events - Archive of obsolete content
listener : function the function we registered to listen for events.
Low-Level APIs - Archive of obsolete content
system/unload register callbacks that are called when a module is unloaded.
Getting started (cfx) - Archive of obsolete content
xpi: { command: [ 'cd pluginpath', 'cfx xpi', 'wget --post-file=pluginname.xpi http://localhost:8888/ || echo>/dev/null' ].join('&&') } }, watch: { xpi: { files: ['pluginpath/**'], tasks: ['shell:xpi'] } } }); grunt.loadnpmtasks('grunt-contrib-watch'); grunt.loadnpmtasks('grunt-shell'); grunt.registertask('default', ['watch']); }; ...
Bootstrapped extensions - Archive of obsolete content
not all chrome.manifest instructions are supported in bootstrapped add-ons, for example you still cannot register xul overlays from a bootstrapped add-on.
Extension Theming Guidelines - Archive of obsolete content
custom themes may then register a replacement for your skin package allowing them to provide their own styles for all of your content.
Extension Etiquette - Archive of obsolete content
xpcom contract ids, which are often registered in chrome.manifest files.
Inline options - Archive of obsolete content
this requires that you register a content path in the chrome.manifest.
Migrating raw components to add-ons - Archive of obsolete content
they will be registered the first time firefox is run once your add-on is installed.
Appendix F: Monitoring DOM changes - Archive of obsolete content
* @optional @default document * * @returns {function} a function which may be called to unregister the * listener.
Connecting to Remote Content - Archive of obsolete content
following initialization, onload and onerror handlers are registered to a callback function to handle the response returned from the remote server.
Setting Up a Development Environment - Archive of obsolete content
one of the most common errors developers make is to register a js event listener or observer, and never removing it.
Security best practices in extensions - Archive of obsolete content
for example, if you load a chrome url, this means the content has been registered with firefox and has full access.
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
should either be like "application/x-vnd-yourorganization-yourfiletype" or be officially registered with iana (unlikely) or be a standard type (e.g.
Making it into a dynamic overlay and packaging it up for distribution - Archive of obsolete content
ator.xul"> <rdf:li>chrome://tinderstatus/content/tinderstatusoverlay.xul</rdf:li> </rdf:seq> </rdf:rdf> install.js, on the other hand, goes into the tinderstatus-installer directory: initinstall( "mozilla tinderstatus extension", "/mozdev/tinderstatus", "0.1"); var installdir = getfolder("chrome","tinderstatus"); setpackagefolder(installdir); adddirectory("tinderstatus"); registerchrome( content | delayed_chrome, getfolder(installdir, "content")); var result = performinstall(); if ( result != success ) cancelinstall(result); once all the files are in place, use your zip utility from within the tinderstatus-installer directory to create a zip archive called tinderstatus.xpi with install.js and the entire contents of the tinderstatus/ directory.
Plug-n-Hack Phase1 - Archive of obsolete content
this can cause the browser to inspect the manifest and register the tool by firing a customevent with the type configuresectool and a properties object which specifies the url of the tool manifest.
Using gdb on wimpy computers - Archive of obsolete content
nsnativecomponentloader: autoregistering begins.
XBL 1.0 Reference - Archive of obsolete content
bindings can contain event handlers that are registered on the bound element, an implementation of new methods and properties that become accessible from the bound element, and anonymous content that is inserted around the bound element.
XBL - Archive of obsolete content
bindings can contain event handlers that are registered on the bound element, an implementation of new methods and properties that become accessible from the bound element, and anonymous content that is inserted underneath the bound element.
Install Wizards (aka: Stub Installers) - Archive of obsolete content
the stub installer calls some glue code: xpistub which resides at: < http://lxr.mozilla.org/seamonkey/sou...pinstall/stub/> this "glue" code initialized xpcom and registers the xpinstall engine and requisite components to prepare for use by the stub installer.
Using XPInstall to Install Plugins - Archive of obsolete content
this is done via the created function, called function registerplid().
InstallTrigger.installChrome - Archive of obsolete content
when a user clicks the link "install the new blue theme" in the example below, xpinstall downloads, registers, and installs the theme contained in newblue.xpi to the user's profile directory.
windowsGetShortName - Archive of obsolete content
method of file object syntax string windowsgetshortname( object localdirspec ) parameters the windowsregisterserver method has the following parameter: localdirspec a filespecobject representing a directory obtained by getcomponentfolder or getfolder.
Methods - Archive of obsolete content
windowsregisterserver registers dlls with the registry.
initInstall - Archive of obsolete content
the client version registry is a hierarchical description of the software registered for use with netscape 6.
performInstall - Archive of obsolete content
moves all components to their final locations, launches any pending executions, and registers the package and all of its subcomponents in the client version registry.
reserved - Archive of obsolete content
this means that, to execute these commands, key events won't be passed to content, and event listeners registered for them in content will not be executed.
How to implement a custom XUL query processor component - Archive of obsolete content
custom query processors are xpcom components, must implement the nsixultemplatequeryprocessor interface and follow some conventions for when registering the component.
Providing Command-Line Options - Archive of obsolete content
extensions and xul applications can modify the way command line parameters are handled by writing a component that implements the nsicommandlinehandler interface and registering it in a category.
Creating an Installer - Archive of obsolete content
the contents.rdf files have also been added because they will be needed to register the chrome files.
Focus and Selection - Archive of obsolete content
it registers a capturing event handler with the window which will call the setfocusedelement method.
Manifest Files - Archive of obsolete content
next, you are going to register the new application with mozilla so it will know where to find it.
More Event Handlers - Archive of obsolete content
prevent default action if no event handlers have been registered for an event, then after completing the capturing and bubbling phases, the element will handle the event in a default way.
The Chrome URL - Archive of obsolete content
the packages included with mozilla will already be installed but you can register your own.
XUL accessibility guidelines - Archive of obsolete content
<dialog id="print_dialog" title="print" ...> <window id="mywindow" title="my application" ...> <wizard id="reg_window" title="register your software" ...> form labels labels are not automatically associated to form elements.
The Implementation of the Application Object Model - Archive of obsolete content
in order to accomplish this, our architecture has to have some sort of facility whereby different types of content, e.g., mail and bookmarks, can register themselves as the appropriate content to be instantiated for a given uri.
command - Archive of obsolete content
this means that, to execute these commands, key events won't be passed to content, and event listeners registered for them in content will not be executed.
window - Archive of obsolete content
--> <window id="rootwnd" title="register online!" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <vbox> <hbox> <image src="application_form.png"/> <description>register online!</description> </hbox> <groupbox align="start"> <caption label="your information"/> <radiogroup> <vbox> <hbox> <label control="your-fname" value="enter first name:"...
Application Update - Archive of obsolete content
p.update.interval", 86400); // interval: time before prompting the user to download a new version that // is available (in seconds) default=1 day pref("app.update.nagtimer.download", 86400); // interval: time before prompting the user to restart to install the latest // download (in seconds) default=30 minutes pref("app.update.nagtimer.restart", 1800); // interval: when all registered timers should be checked (in milliseconds) // default=5 seconds pref("app.update.timer", 600000); // whether or not we show a dialog box informing the user that the update was // successfully applied.
Debugging a XULRunner Application - Archive of obsolete content
troubleshooting x-jsd is not a registered protocol if the message "x-jsd is not a registered protocol" appears when trying to open *.js files in venkman, then add an empty file called .autoreg in the same directory as your xulrunner binary.
Getting started with XULRunner - Archive of obsolete content
note: in xulrunner 2.0, the chrome.manifest is now used to register xpcom components in addition to its previous uses.
XUL Application Packaging - Archive of obsolete content
they can be installed to xulrunner with a command line flag "--install-app" if xulrunner is registered on the system.
nsIContentPolicy - Archive of obsolete content
} // and this into your implementation file ns_impl_isupportsn(myclass, nsisupports, nsicontentpolicy, ...) note: before you can recieve notifications, you must register your plugin with nsicategorymanager.
Archived Mozilla and build documentation - Archive of obsolete content
chromeless [this project may not be active — check github https://github.com/mozilla/chromeless] creating a firefox sidebar extension this article describes how to create a registered sidebar for firefox 2 or greater.
Gecko Compatibility Handbook - Archive of obsolete content
testing aol from within a firewall if you need to connect to aol via a corporate firewall, america online has registered tcp/ip ports 5190 and 11523 so you can communicate with the aol client software.
2006-12-01 - Archive of obsolete content
rich results for searches a proposal to implement "rich results", a set of registered sites that would provide information as it relates to a user's search.
Extentsions FAQ - Archive of obsolete content
you can write a dummy xpcom component implementing the necessary interfaces and register it with the sane contract id.
NPAPI plugin developer guide - Archive of obsolete content
nce windowed and windowless plug-ins the default plug-in using html to display plug-ins plug-in display modes using the object element for plug-in display nesting rules for html elements using the appropriate attributes using the embed element for plug-in display using custom embed attributes plug-in references plug-in development overview writing plug-ins registering plug-ins ms windows unix mac os x drawing a plug-in instance handling memory sending and receiving streams working with urls getting version and ui information displaying messages on the status line making plug-ins scriptable building plug-ins building, platforms, and compilers building carbonized plug-ins for mac os x type libraries installing plug-i...
NPN_PluginThreadAsyncCall - Archive of obsolete content
the browser might not execute calls successfully registered with this api call during plug-in termination.
The First Install Problem - Archive of obsolete content
at present plugins registered using the hkey_current_user\software\mozillaplugins\ tree are ignored by firefox (bug 293062) but this is fixed in trunk builds (bug 293062).
Building a Theme - Archive of obsolete content
without it, the package won't be registered.
Using workers in extensions - Archive of obsolete content
let's take a look: startup: function() { // register to receive notifications of preference changes this.prefs = components.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefservice) .getbranch("stockwatcher2."); this.prefs.queryinterface(components.interfaces.nsiprefbranch2); this.prefs.addobserver("", this, false); this.tickersymbol = this.prefs.getcharpref("symbol").toupperca...
GetObject - Archive of obsolete content
if an object has registered itself as a single-instance object, only one instance of the object is created, no matter how many times activexobject is executed.
Describing microformats in JavaScript - Archive of obsolete content
the microformat is registered with the microformat api by calling microformats.add(), like this: microformats.add("adr", adr_definition); note: to be clear: since the adr microformat is included by default in firefox 3 and later, you don't need to add it yourself if you wish to make use of it.
XUL Booster - Archive of obsolete content
it supports exporting xpi files or registering a file system based project.
Building up a basic demo with PlayCanvas editor - Game development
creating an account the playcanvas editor is free — all you have to do to begin with is register your account and login: when you first sign up, you are taken straight into the editor and given a simple starter tutorial involving editing a 3d rolling ball game.
JavaScript - MDN Web Docs Glossary: Definitions of Web-related terms
although "java" and "javascript" are trademarks (or registered trademarks) of oracle in the u.s.
Localization - MDN Web Docs Glossary: Definitions of Web-related terms
following are common factors to consider: language unit of measure (e.g., kilometers in europe, miles in u.s.) text direction (e.g., european languages are left-to-right, arabic right-to-left) capitalization in latin script (e.g., english uses capitals for weekdays, spanish uses lowercase) adaptation of idioms (e.g., "raining cats and dogs" makes no sense when translated literally) use of register (e.g., in japanese respectful speech differs exceptionally from casual speech) number format (e.g., 10 000,00 in germany vs.
TCP slow start - MDN Web Docs Glossary: Definitions of Web-related terms
the server registers this as missing acks.
Time to interactive - MDN Web Docs Glossary: Definitions of Web-related terms
tti, proposed by the web incubator community group in 2018, is intended to provide a metric that describes when a page or application contains useful content and the main thread is idle and free to respond to user interactions, including having event handlers registered.
Third-party APIs - Learn web development
when the developer has registered for a key, they are then known to the api provider, and action can be taken if they start to do anything malicious with the api (such as tracking people's location or trying to spam the api with loads of requests to stop it working, for example).
Vue conditional rendering: editing existing todos - Learn web development
first of all add v-if="!isediting" to the root <div> in your todoitem component, <div class="stack-small" v-if="!isediting"> next, below that <div>'s closing tag add the following line: <to-do-item-edit-form v-else :id="id" :label="label"></to-do-item-edit-form> we also need to import and register the todoitemeditform component, so we can use it inside this template.
Adding a new todo form: Vue events, methods, and models - Learn web development
go back to app.vue and add the following import statement just below the previous one, inside your <script> element: import todoform from './components/todoform'; you also need to register the new component in your app component — update the components property of the component object so that it looks like this: components: { todoitem, todoform } finally for this section, render your todoform component inside your app by adding the <to-do-form /> element inside your app's <template>, like so: <template> <div id="app"> <h1>my to-do list</h1> <to-do-form><...
Adding a new event
register each event into eventnamelist.h if you're in case 3, you can skip this section.
A bird's-eye view of the Mozilla framework
likewise, an xpcom component must implement nsifactory, which provides a mechanism for creating an object without having access to the class declaration for that object, nsimodule, which provides a mechanism for registering and unregistering the xpcom component, as well as for accessing the underlying class objects implementing the idl interfaces, and nsgetmodule(), the entry point used to load the xpcom component.
Creating reftest-based unit tests
register them in the chrome package in layout/tools/reftest/jar.mn, and reference the chrome uris in the manifest file (see an example).
Listening to events on all tabs
if any registered progress listener returns false from this method then the attempt to refresh will be blocked.
Frame script loading and lifetime
to define the mapping between a chrome:// url and a frame script packaged with an extension, use a "chrome.manifest" file to register a chrome url: // chrome.manifest content my-e10s-extension chrome/content/ // chrome script mm.loadframescript("chrome://my-e10s-extension/content/content.js", true); allowdelayedload if the message manager is a global frame message manager or a window message manager then: if allowdelayedload is true, the frame script will be loaded into any new frame, which has opened after the loadfr...
ChromeWorker
addons that wish to use file:// urls must first register a resource replacement path, using code like this: var fileuri = services.io.newfileuri(file); services.io.getprotocolhandler('resource').
JavaScript Tips
for instance the offline observer declared above is a javascript object that is registered with an xpcom object, so that the call back from xpcom executes the javascript method.
AddonListener
addonlisteners can be registered with addaddonlistener() and will then receive notification of changes to the add-ons currently installed.
InstallListener
they may be registered to hear events from all addoninstalls through addinstalllistener or to a single addoninstall through addlistener.
TypeListener
typelisteners can be registered with addtypelistener() and will then receive notification as addontype are registered and unregistered.
Downloads.jsm
components.manager.queryinterface(components.interfaces.nsicomponentregistrar) .registerfactory(components.id("{1b4c85df-cbdd-4bb6-b04e-613caece083c}"), "", "@mozilla.org/transfer;1", null); ...
FxAccountsOAuthClient.jsm
registers a webchannel listener and sets up a callback if needed.
Promise.jsm
this method registers callback functions that are called as soon as the promise is either fulfilled or rejected.
PromiseWorker.jsm
function customerror(message) { this.message = message; } customerror.frommsg = function(msg) { return new customerror(msg.message); }; // register a constructor.
Bootstrapping a new locale
when a localization team is registered and your hg repository is set up for a locale, you can then clone the existing mozilla release branch (i.e.
Localizing with Mercurial
for peers of a localization, the owner can vouch (once she or he is registered).
Initial setup
mozilla ldap you will need a mozilla ldap account once you're ready to have your localization registered on the main mozilla repositories.
Release phase
your official release repository now that your locale has been registered, the localization files will live on mozilla mercurial server at hg.mozilla.org.
Gecko Profiler FAQ
we have not attempted to register other threads with the profiler.
JS::PerfMeasurement
jsobject* js::registerperfmeasurement(jscontext* cx, jsobject* global) you shouldn't need to use this function, but we mention it for completeness.
Power profiling overview
intel processors have model-specific registers (msrs) containing measurements of how much time is spent in different c-states, and tools such as powermetrics (mac), powertop and turbostat (linux) can expose this information.
tools/power/rapl
windows unfortunately, rapl does not work on windows, and porting it would be difficult because windows does not have apis that allow easy access to the relevant model-specific registers.
Introduction to NSPR
these resources include the thread stack and the cpu register set (including pc).
PRIntervalTime
at that rate, a 32-bit register will overflow in approximately 28 hours, making the maximum useful interval approximately 6 hours.
Threads
these resources include a stack and the cpu registers (including pc).
NSS_3.11.10_release_notes.html
bug 398680: assertion botch in ssl3_registerserverhelloextensionsender doing second handshake with ssl_forcehandshake bug 403240: threads hanging in nss_initlock bug 403888: memory leak in trustdomain.c bug 416067: certutil -l -h token doesn't report token authentication failure bug 417637: tstclnt crashes if -p option is not specified bug 421634: don't send an sni client hello extension bearing an ipv6 address bug 422918: add v...
NSS 3.12.6 release notes
de headers from lib/ckfw bug 535669: move common makefile code in if and else to the outside bug 536023: der_utctimetotime and der_generalizedtimetotime ignore all bytes after an embedded null bug 536474: add support for logging pre-master secrets bug 537356: implement new safe ssl3 & tls renegotiation bug 537795: nss_initcontext does not work with nss_registershutdown bug 537829: allow nss to build for android bug 540304: implement ssl_handshakenegotiatedextension bug 541228: remove an obsolete nspr version check in lib/util/secport.c bug 541231: nssinit.c doesn't need to include ssl.h and sslproto.h.
NSS_3.12_release_notes.html
tepbev2algorithmid (see pk11pub.h) pk11_destroymergelog (see pk11pub.h) pk11_generatekeypairwithopflags (see pk11pub.h) pk11_getpbecryptomechanism (see pk11pub.h) pk11_isremovable (see pk11pub.h) pk11_mergetokens (see pk11pub.h) pk11_writerawattribute (see pk11pub.h) seckey_ecparamstobasepointorderlen (see keyhi.h) seckey_ecparamstokeysize (see keyhi.h) secmod_deletemoduleex (see secmod.h) sec_getregisteredhttpclient (see ocsp.h) sec_pkcs5isalgorithmpbealgtag (see secpkcs5.h) vfy_createcontextdirect (see cryptohi.h) vfy_createcontextwithalgorithmid (see cryptohi.h) vfy_verifydatadirect (see cryptohi.h) vfy_verifydatawithalgorithmid (see cryptohi.h) vfy_verifydigestdirect (see cryptohi.h) vfy_verifydigestwithalgorithmid (see cryptohi.h) new macros for camellia support (see blapit.h): nss_camelli...
NSS 3.15.4 release notes
in addition to enabling the ssl_enable_false_start option, an application must now register a callback using the ssl_setcanfalsestartcallback function.
NSS 3.30 release notes
in ssl.h ssl_alertreceivedcallback - register a callback function, that will be called whenever an ssl/tls alert is received ssl_alertsentcallback - register a callback function, that will be called whenever an ssl/tls alert is sent ssl_setsessionticketkeypair - configures an asymmetric key pair, for use in wrapping session ticket keys, used by the server.
NSS 3.37 release notes
nss allows servers now to register alpn handling callbacks to select a protocol.
NSS API Guidelines
these macros only define code when debug is turned on, providing a way for systems to register, deregister, and check valid pointers.
NSS sources building testing
on machines that are configured with a hostname that has been registered in your network's dns, this should work automatically.
NSS_3.12.3_release_notes.html
th_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.h): nss_use_alg_in_cert_signature nss_use_alg_in_cms_signature nss_use_alg_res...
GCIntegration - SpiderMonkey Redirect 1
this should be obvious by now, but never ever allow a gc thing point to a gc thing in a different compartment unless it's a wrapper that's registered in the cross-compartment wrapper map.
64-bit Compatibility
a native integer is the size used for intptr_t/uintptr_t, which is usually the width of a general-purpose register on the target cpu.
Garbage collection
handle in our gc, a handle is a pointer that has elsewhere been registered by a root.
JS::Add*Root
this article covers features introduced in spidermonkey 31 register a variable as a member of the garbage collector's root set, to protect anything the root points at from garbage collection.
JS::PersistentRooted
they are registered with the jsruntime itself, without locking, so they require a full jscontext to be initialized, not one of its more restricted superclasses.
JS::Remove*Root
this article covers features introduced in spidermonkey 31 unregister a pointer to a gc thing so that it is no longer a member of the garbage collector's root set.
JS_AddExternalStringFinalizer
register a custom string memory manager.
JS_Add*Root
register a variable as a member of the garbage collector's root set, to protect anything the root points at from garbage collection.
JS_NewGlobalObject
debugger api hook during global creation, we fire notifications to callbacks registered via the debugger api.
JS_RemoveExternalStringFinalizer
unregister a custom string memory manager.
JS_Remove*Root
unregisters a pointer to a gc thing so that it is no longer a member of the garbage collector's root set.
JS_SetExtraGCRoots
this article covers features introduced in spidermonkey 1.8 register externally maintained gc roots.
Secure Development Guidelines
introduction provide developers with information on specific security issues cover common coding mistakes and how they affect a product how to avoid making them how to mitigate them everything is oriented toward c/c++ introduction: gaining control specifics about the underlying architecture, using x86 as an example 6 basic registers (eax, ebx, ecx, edx, edi, esi) 2 stack-related registers (esp, ebp) mark top and bottom of current stack frame status register (eflags) contains various state information instruction pointer (eip) points to register being executed; can’t be modified directly introduction: gaining control (2) eip is modified using call or jump instructions attacks usual...
XUL Accessibility
<description value="it's label for control" control="control" /> <hbox role="grouping" id="control" /> get tooltiptext attribute value if the aria role is used and it allows to have accessible value then aria-valuetext or aria-valuenow are used if the element is xlink then value is generated from link location actions if the element is xlink then jump action is exposed if the element has registered click event handler then click action is exposed xul elements notification used to display an informative message.
Places Developer Guide
}, queryinterface: function(iid) { if (iid.equals(ci.nsinavbookmarkobserver) || iid.equals(ci.nsisupports)) { return this; } throw cr.ns_error_no_interface; }, }; // register the observer with the bookmarks service var bmsvc = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); bmsvc.addobserver(observer, false); // un-register the observer when done.
Places utilities for JavaScript
boolean nodeislivemarkcontainer(anode) determines whether a result node is a remote container registered by the livemark service.
The Publicity Stream API
this spawns a doorhanger which allows the user to specify which users can view the activity, and (following successful login and authorization with the stream server) registers the activity in a stream at [address].
extIPreferenceBranch
see bug 481044 void reset() parameters return value examples var myext = application.extensions.get('myapplicationid'); function myfunc (event) { application.console.log('change!'); }; myext.prefs.get("myprefname").events.addlistener("change", myfunc); see also fuel (firefox), steel (thunderbird) and smile (seamonkey) known issues bug 488587 - function registered as fuel preference listener not always called ...
Generic factory
; } many of our classes already have a static entry point that serves as the creator function, so in most cases, creating a new factory for a class is just: nsifactory* newmallocfactory() { nsifactory* factory = new nsgenericfactory(&nsmalloc::create); factory->addref(); return factory; } talking to warren, he suggests that we even provide a shorthand for this, we should be able to register a factory with just a function pointer.
An Overview of XPCOM
ns_error_factory_not_registered returned when a requested class is not registered.
Preface
for example, the introduction includes a discussion of components and what they are, and the first chapter - in which you compile the basic code and register it with mozilla - prompts a discussion of the relationship between components and modules, of xpcom interfaces, and of the registration process in general.
Setting up the Gecko SDK
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.
Using XPCOM Components
it registers itself for use when the browser starts up, and provides a factory that creates an instance of it for use when the user or administrator clicks the weblock icon in the browser's user interface.
Interfacing with the XPCOM cycle collector
this is the idle stage of the collector's operation, in which special variants of nsautorefcnt register and unregister themselves very rapidly with the collector, as they pass through a "suspicious" refcount event (from n+1 to n, for nonzero n).
Components.ID
the exception to this is the case where a component is written in javascript and needs to register itself with the component manager using its own nsid - an id that is not already registered and thus does not appear in components.classes.
Components.classesByID
components.classesbyid is exactly like components.classes except that the elements are indexed by the canonical form of their cid, and does not only represent the component classes that have been registered with the component manager using a contractid, but also those registered using a plain cid.
NS_InitXPCOM3
passing null causes the default (built-in) static modules to be registered, if present.
amIWebInstallListener
the registered amiwebinstalllistener is used to notify about new installs triggered by websites.
nsIAboutModule
the uri passed in is guaranteed to be one of the uris that this module registered to deal with.
nsIAnnotationService
removeobserver() this method removes an annotaton observer previously registered by addobserver() method.
nsICategoryManager
they are often used to register lists of contractids, corresponding to components that wish to be notified of various events by some subsystem.
nsIChromeRegistry
chrome/public/nsichromeregistry.idlscriptable provides access to the chrome registry; you can use this to get information about chrome documents that have been registered.
nsICommandLineHandler
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) each command line handler is registered in the category "command-line-handler".
nsIConsoleListener
listeners must first be attached to the service using nsiconsoleservice.registerlistener() void observe( in nsiconsolemessage amessage ); parameters amessage the nsiconsolemessage being posted.
nsIContentFrameMessageManager
examples once you obtain the conten frame messge manager, you can send messages to listeners who registered with services.mm.addmessagelistener get content message manager from browser this could would run in a nsidomwindow scope.
nsIDBChangeListener
only registered pending listeners are notified.
nsIDOMWindowUtils
these additional style sheets are very much like user/agent sheets loaded with loadandregistersheet.
nsIDynamicContainer
it can also create additional containers for each container, registered to its service.
nsIEffectiveTLDService
a public suffix is the highest-level domain under which individual domains may be registered; it may therefore contain one or more dots.
nsIFeedContainer
see nsifeedresult.registerextensionprefix() for more information about prefixes.
nsIHttpActivityDistributor
netwerk/protocol/http/nsihttpactivityobserver.idlscriptable this interface is used to register and unregister clients that wish to observe http transport activity.
nsILivemarkService
ns_error_malformed_uri if the site uri annotation has somehow been corrupted (and can't be turned into an nsiuri) getlivemarkidforfeeduri() determines whether the feed uri is a currently registered livemark.
nsILoginManagerStorage
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) for example, if you wish to provide operating system integration with a native password manager system, implementing and registering a storage module for the login manager is how you do it.
nsIMemory
a client that wishes to be notified of low memory situations (for example, because the client maintains a large memory cache that could be released when memory is tight) should register with the observer service (see nsiobserverservice) using the topic "memory-pressure".
nsIMemoryReporter
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) any piece of code that wishes to allow its memory use to be monitored may create an nsimemoryreporter object and then register it by calling nsimemoryreportermanager.registerreporter().
nsIMessageSender
this invokes listeners who registered for messagename using a nsimessagelistenermanager.
nsIMicrosummaryService
if its value is null, then it's an async refresh, and the caller should register itself as an nsimicrosummaryobserver via nsimicrosummary.addobserver() to find out when the refresh completes.
Building an Account Manager Extension
if (server.type == \"imap\") return true; return false; }, queryinterface: xpcomutils.generateqi([ components.interfaces.nsimsgaccountmanagerextension ]) } step 2: building a component we convert the interface to a xpcom component and register it in the component manager as account manager extension.
nsIMsgAccountManagerExtension
you have to register any new account manager extensions via the the category manager at start up.
nsINavHistoryContainerResultNode
the container may be a result_type_remote_container node that has been dynamically generated by the remote container api, or a bookmark folder (result_type_folder) for which some service (such as livemarks) has registered to provide certain operations.
nsINavHistoryResult
viewers register themselves through the registerviewer() method.
nsIProtocolProxyFilter
use nsiprotocolproxyservice.registerfilter() to hook up instances of this interface.
nsIPushSubscription
1"] .getservice(ci.nsiscriptsecuritymanager); const pushservice = cc["@mozilla.org/push/service;1"] .getservice(ci.nsipushservice); function sendsubscriptiontoserver(subscription) { let request = cc["@mozilla.org/xmlextras/xmlhttprequest;1"] .createinstance(ci.nsixmlhttprequest); request.open("post", "https://example.com/register-for-push", true); request.addeventlistener("error", () => { cu.reporterror("error sending subscription to server"); }); request.send(json.stringify({ endpoint: subscription.endpoint, // base64-encode the key and authentication secret.
nsISHistory
methods addshistorylistener() called to register a listener for the session history component.
nsISHistoryListener
a session history listener can be registered on a particular nsishistory instance via the nsishistory.addshistorylistener() method.
nsIStringBundleService
createextensiblebundle() nsistringbundle createextensiblebundle( in string aregistrykey ); parameters aregistrykey the name of the category under which the properties file(s) have been registered.
nsISyncMessageSender
this invokes listeners who registered for messagename using a nsimessagelistenermanager.
nsITaskbarPreview
note: changing this value is computationally expensive for tab previews, because doing so causes the proxy window to be destroyed and rebuilt, then re-registered with the taskbar.
nsITaskbarTabPreview
if a preview is not registered, the api call to set its sibling (via the move() method) will fail silently.
nsITraceableChannel
1.0 66 introduced gecko 1.9.0.4 inherits from: nsisupports last changed in gecko 1.9.0.4 the typical way to use this interface is as follows: register for the "http-on-examine-response" notification to track all http responses; skip redirects (responsestatus = 3xx on nsihttpchannel), since otherwise you may end up with two listeners registered for a channel; qi the channel passed as the "subject" to your observer to nsitraceablechannel, and replace the default nsistreamlistener (that passes the data to the original requester - e.g.
nsIWebNavigationInfo
note: this method may cause plug-ins to be rescanned in order to ensure they are properly registered for the types they support.
nsIXULRuntime
this will cause components to be auto registered and all fast load data to be re-created.
Weak reference
what is actually needed in this case, is either out-of-band signaling, where when the observer wants to go away, it unregisters itself from the observable, which then releases its owning reference, allowing the observer to die, or else a new kind of reference.
XPCOM category image-sniffing-services
if mozilla's built-in image code cannot identify an image, then any xpcom components implementing the nsicontentsniffer interface may register under the "image-sniffing-services" category, and will be queried to determine the mime type of the image being downloaded.
wrappedJSObject
suppose we register the component below with the @myself.com/my-component;1 contract.
XUL Overlays
MozillaTechXULOverlays
when a component such as the "super stream player" from the examples above is registered there, overlays associated with that component are loaded automatically.
Autoconfiguration in Thunderbird
domain hoster if you are an isp that hosts domains for your customers - for example, you are hoster.com and your customer registers fancy.com or example.com, and your servers accept and serve the mail for example.com -, you should set up an autoconfig server.
Building a Thunderbird extension 6: Adding JavaScript
ad", function(e) { startup(); }, false); window.setinterval( function() { startup(); }, 60000); //update date every minute function startup() { var mypanel = document.getelementbyid("my-panel"); var date = new date(); var day = date.getday(); var datestring = date.getfullyear() + "." + (date.getmonth()+1) + "." + date.getdate(); mypanel.label = "date: " + datestring; } the first part registers a new event listener that will be executed automatically when thunderbird loads.
Creating a Custom Column
what happens is: usually, the event sequence is: jsm load -> onload -> msgcreatedbview with enigmail, the event sequence becomes jsm load -> msgcreatedbview -> onload to workaround this, you can either i) manually run addcustomhandler() at the end of your onload handler or ii) register createdbobserver when your .jsm is loaded.
Activity Manager examples
} sendercontextdisplayhelper.prototype = { getcontextdisplaytext: function(contexttype, contextobj) { // in this particular example we know that contexttype is "sender" // since we also pass the contexttype along with the contextobject // in some cases, one helper can be registered for a group of context types // we know that the context object is the author of the message // localization is omitted return "messages coming from " + contextobj.surname + ", " + contextobj.firstname; } } // step 2: register the helper for this context type gactivitymanager.registercontextdisplayhelper("sender", new sendercontextdisplay...
Detect Opening Folder
some actions require execution every time you open a folder (for example, registering a custom column handler.
Theme Packaging
you must have a top-level chrome.manifest file which registers the chrome for the theme (as before) and also an install.rdf manifest that specifies metadata that is displayed in the appearance section of the add-ons manager.
Using MAPI with Thunderbird's Windows 7 developer builds
(be sure to copy - not move - these files.) in the uninstall sub-directory of the bin directory, run these two commands: helper.exe /setasdefaultappglobal helper.exe /setasdefaultappuser create an elevated shell and register the mapi proxy.dll as a com server.
libmime content type handlers
the primary * purpose of these handlers will be to represent the attached data in a * viewable html format that is useful for the user * * note: these will all register by their content type prefixed by the * following: mimecth:text/vcard * * libmime will then use nscomponentmanager::contractidtoclsid() to * locate the appropriate content type handler */ #ifndef nsimimecontenttypehandler_h_ #define nsimimecontenttypehandler_h_ typedef struct { prbool force_inline_display; } contenttypehandlerinitstruct; #include "prtypes...
Declaring and Using Callbacks
warning: callbacks must be invoked on the same thread with which they were registered.
Drawing and Event Handling - Plugins
windows on windows, the browser registers a window class and creates an instance of that class for the plug-in instance.
Plug-in Side Plug-in API - Plugins
np_getmimedescription registers the mime types supported by the plug-in (unix, mac os).
Gecko Plugin API Reference - Plugins
nce windowed and windowless plug-ins the default plug-in using html to display plug-ins plug-in display modes using the object element for plug-in display nesting rules for html elements using the appropriate attributes using the embed element for plug-in display using custom embed attributes plug-in references plug-in development overview writing plug-ins registering plug-ins ms windows unix mac os x drawing a plug-in instance handling memory sending and receiving streams working with urls getting version and ui information displaying messages on the status line making plug-ins scriptable building plug-ins building, platforms, and compilers building carbonized plug-ins for mac os x type libraries installing plug-i...
Index - Firefox Developer Tools
29 devtools api devtools the devtools api provides a way to register and access developer tools in firefox.
Web Audio Editor - Firefox Developer Tools
if you have feedback or suggestions for new features, dev-developer-tools or twitter are great places to register them.
AudioWorkletNode() - Web APIs
a processor with the provided name must first be registered using the audioworkletglobalscope.registerprocessor() method.
AuthenticatorAttestationResponse.attestationObject - Web APIs
the webauthn specification defines a number of formats; however, formats may also be defined in other specifications and registered in an iana registry.
BatteryManager - Web APIs
methods inherited from eventtarget: eventtarget.addeventlistener() registers an event handler of a specific event type on the eventtarget.
CSS - Web APIs
WebAPICSS
css.registerproperty() registers custom properties, allowing for property type checking, default values, and properties that do or do not inherit their value.
CSSPseudoElement - Web APIs
methods csspseudoelement extends eventtarget, so it inherits the following methods: eventtarget.addeventlistener() registers an event handler of a specific event type on the pseudo-element.
Cache.match() - Web APIs
WebAPICachematch
if there are any other fetch handlers registered, they will get a chance to call event.respondwith().
Cache - Web APIs
WebAPICache
note: in chrome, visit chrome://inspect/#service-workers and click on the "inspect" link below the registered service worker to view logging statements for the various actions the service-worker.js script is performing.
Clients.claim() - Web APIs
WebAPIClientsclaim
when a service worker is initially registered, pages won't use it until they next load.
Constraint validation API - Web APIs
if you don't do this, and a custom validity was previously set, the input will register as invalid, even if it current contains a valid value on submission.
CustomElementRegistry - Web APIs
the customelementregistry interface provides methods for registering custom elements and querying registered elements.
CustomEvent - Web APIs
event.currenttarget read only a reference to the currently registered target for the event.
DataTransfer.clearData() - Web APIs
e; border: 1px solid black; } #target { border: 1px solid black; } javascript window.addeventlistener('domcontentloaded', function () { // select html elements var draggable = document.getelementbyid('source'); var dropable = document.getelementbyid('target'); var status = document.getelementbyid('status'); var data = document.getelementbyid('data'); var dropped = false; // register event handlers draggable.addeventlistener('dragstart', dragstarthandler); draggable.addeventlistener('dragend', dragendhandler); dropable.addeventlistener('dragover', dragoverhandler); dropable.addeventlistener('dragleave', dragleavehandler); dropable.addeventlistener('drop', drophandler); function dragstarthandler (event) { status.innerhtml = 'drag in process'; // change ta...
Detecting device orientation - Web APIs
window.addeventlistener("deviceorientation", handleorientation, true); after registering your event listener (in this case, a javascript function called handleorientation()), your listener function periodically gets called with updated orientation data.
Document.domain - Web APIs
WebAPIDocumentdomain
exceptions securityerror an attempt has been made to set domain under one of the following conditions: the document is inside a sandboxed <iframe> the document has no browsing context the document's effective domain is null the given value is not equal to the document's effective domain (or it is not a registerable domain suffix of it) the document-domain feature-policy is enabled examples getting the domain for the uri http://developer.mozilla.org/docs/web, this example sets currentdomain to the string "developer.mozilla.org".
Document.ononline - Web APIs
WebAPIDocumentononline
you can register listeners for these events in a few familiar ways: using addeventlistener on the window, document, or document.body by setting the .ononline or .onoffline properties on document or document.body to a javascript function object.
Document.open() - Web APIs
WebAPIDocumentopen
for example: all event listeners currently registered on the document, nodes inside the document, or the document's window are removed.
Events and the DOM - Web APIs
registering event listeners there are 3 ways to register event handlers for a dom element.
Examples of web and XML development using the DOM - Web APIs
when the body of this html document loads, an event listener is registered with the top row of the table.
Element.attributes - Web APIs
the element.attributes property returns a live collection of all attribute nodes registered to the specified node.
Element - Web APIs
WebAPIElement
eventtarget.addeventlistener() registers an event handler to a specific event type on the element.
Event - Web APIs
WebAPIEvent
event.currenttarget read only a reference to the currently registered target for the event.
EventTarget - Web APIs
methods eventtarget.addeventlistener() registers an event handler of a specific event type on the eventtarget.
ExtendableMessageEvent - Web APIs
// in the page being controlled if (navigator.serviceworker) { navigator.serviceworker.register('service-worker.js'); navigator.serviceworker.addeventlistener('message', event => { // event is a messageevent object console.log(`the service worker sent me a message: ${event.data}`); }); navigator.serviceworker.ready.then( registration => { registration.active.postmessage("hi service worker"); }); } the service worker can receive the message by listening to the message...
Geolocation.clearWatch() - Web APIs
the geolocation.clearwatch() method is used to unregister location/error monitoring handlers previously installed using geolocation.watchposition().
Geolocation API - Web APIs
geolocation.watchposition(): registers a handler function that will be called automatically each time the position of the device changes, returning the updated location.
HTMLScriptElement - Web APIs
htmlscriptelement.event is a domstring; an obsolete way of registering event handlers on elements in an html document.
compareVersion - Web APIs
in particular, this method returns one of the following values: -5 component not present or not registered.
getVersion - Web APIs
if the component has not been registered in the client version registry or if the specified component was installed with a null version, this method returns null.
Intersection Observer API - Web APIs
the intersection observer api lets code register a callback function that is executed whenever an element they wish to monitor enters or exits another element (or the viewport), or when the amount by which the two intersect changes by a requested amount.
Keyboard.lock() - Web APIs
WebAPIKeyboardlock
assuming a standard us qwerty layout, registering "keyw" ensures that "w", shift+"w", control+"w", control+shift+"w", and all other key modifier combinations with "w" are sent to the app.
KeyboardEvent.charCode - Web APIs
characters entered through an ime do not register through keycode or charcode.
Keyboard API - Web APIs
assuming a standard united states qwerty layout, registering keyw ensures that "w", shift+"w", control+"w", control+shift+"w", and all other key modifier combinations with "w" are sent to the app.
Long Tasks API - Web APIs
} }); // register observer for long task notifications observer.observe({entrytypes: ["longtask"]}); // long script execution after this will result in queueing // and receiving "longtask" entries in the observer.
MSCandidateWindowHide - Web APIs
web applications need only register for this event once per element (the handler will remain valid for the lifetime of the element).
MSCandidateWindowShow - Web APIs
web applications need only register for this event once per element (the handler will remain valid for the lifetime of the element).
MSCandidateWindowUpdate - Web APIs
tan ime candidate window may be identified as needing to change size for any of the following reasons: as a result of displaying new / changed alternatives or predictions web applications need only register for this event once per element (the handler will remain valid for the lifetime of the element).
MessageChannel - Web APIs
when the iframe has loaded, we register an onmessage handler for messagechannel.port1 and transfer messagechannel.port2 to the iframe using the window.postmessage method along with a message.
MessagePort - Web APIs
when the iframe has loaded, we register an onmessage handler for messagechannel.port1 and transfer messagechannel.port2 to the iframe using the window.postmessage method along with a message.
MouseEvent.pageX - Web APIs
WebAPIMouseEventpageX
ex = document.getelementbyid("x"); var pagey = document.getelementbyid("y"); function updatedisplay(event) { pagex.innertext = event.pagex; pagey.innertext = event.pagey; } box.addeventlistener("mousemove", updatedisplay, false); box.addeventlistener("mouseenter", updatedisplay, false); box.addeventlistener("mouseleave", updatedisplay, false); the javascript code uses addeventlistener() to register the function updatedisplay() as the event handler for the mousemove, mouseenter, and mouseleave events.
msPlayToSource - Web APIs
var ptm = windows.media.playto.playtomanager.getforcurrentview(); // step 2: register for the sourcerequested event (user swipes devices charm).
MutationEvent - Web APIs
mutation events list the following is a list of all mutation events, as defined in dom level 3 events specification: domattrmodified domattributenamechanged domcharacterdatamodified domelementnamechanged domnodeinserted domnodeinsertedintodocument domnoderemoved domnoderemovedfromdocument domsubtreemodified usage you can register a listener for mutation events using eventtarget.addeventlistener() as follows: element.addeventlistener("domnodeinserted", function (event) { // ...
Online and offline events - Web APIs
you can register listeners for these events in a few familiar ways: using addeventlistener on the window, document, or document.body by setting the .ononline or .onoffline properties on document or document.body to a javascript function object.
NetworkInformation.onchange - Web APIs
} // register for event changes: navigator.connection.onchange = changehandler; // another way: navigator.connection.addeventlistener('change', changehandler); specifications specification status comment network information apithe definition of 'onchange' in that specification.
Node.setUserData() - Web APIs
WebAPINodesetUserData
if null, any previously registered object and userdatahandler associated to userkey on this node will be removed.
PaymentRequestEvent() - Web APIs
options optional options are as follows: instrumentkey: a paymentinstrument object reflecting the payment instrument selected by the user or an empty string if the user has not registered or chosen a payment instrument.
PaymentRequestEvent.instrumentKey - Web APIs
the instrumentkey read-only property of the paymentrequestevent interface returns a paymentinstrument object reflecting the payment instrument selected by the user or an empty string if the user has not registered or chosen a payment instrument.
PaymentRequestEvent - Web APIs
properties instrumentkeyread only returns a paymentinstrument object reflecting the payment instrument selected by the user or an empty string if the user has not registered or chosen a payment instrument.
PerformanceEventTiming - Web APIs
const inputsyncprocessingtime = entry.processingend - entry.processingstart; }); }); // register observer for event.
PerformanceFrameTiming - Web APIs
an application can register a performanceobserver for "frame" performance entry types and the observer can retrieve data about the duration of each frame event.
PerformanceObserver() - Web APIs
the observer callback is invoked when performance entry events are recorded for the entry types that have been registered, via the observe() method.
PerformancePaintTiming - Web APIs
an application can register a performanceobserver for "paint" performance entry types and the observer can retrieve the times that paint events occur.
Multi-touch interaction - Web APIs
// log events flag var logevents = false; // event caches, one per touch target var evcache1 = new array(); var evcache2 = new array(); var evcache3 = new array(); register event handlers event handlers are registered for the following pointer events: pointerdown, pointermove and pointerup.
Pinch zoom gestures - Web APIs
// global vars to cache event state var evcache = new array(); var prevdiff = -1; register event handlers event handlers are registered for the following pointer events: pointerdown, pointermove and pointerup.
PushManager.subscribe() - Web APIs
} navigator.serviceworker.register('serviceworker.js'); // use serviceworker.ready to ensure that you can subscribe for push navigator.serviceworker.ready.then( function(serviceworkerregistration) { var options = { uservisibleonly: true, applicationserverkey: applicationserverkey }; serviceworkerregistration.pushmanager.subscribe(options).then( function(pushsubscription) { console.log(pushs...
PushSubscription - Web APIs
pushsubscription.unsubscribe() starts the asynchronous process of unsubscribing from the push service, returning a promise that resolves to a boolean when the current subscription is successfully unregistered.
Resize Observer API - Web APIs
interfaces resizeobserver provides the ability to register new observers and to start and stop observing elements.
Screen - Web APIs
WebAPIScreen
methods screen.lockorientation lock the screen orientation (only works in fullscreen or for installed apps) screen.unlockorientation unlock the screen orientation (only works in fullscreen or for installed apps) methods inherited from eventtarget: eventtarget.addeventlistener() registers an event handler of a specific event type on the eventtarget.
ServiceWorker.onstatechange - Web APIs
for example: navigator.serviceworker.register(..).then(function(swr) { swr.installing.state == "installing" swr.installing.onstatechange = function() { swr.installing == null; // at this point, swr.waiting or swr.active might be true.
ServiceWorker.scriptURL - Web APIs
must be on the same origin as the document that registers the serviceworker.
ServiceWorkerContainer.startMessages() - Web APIs
examples if('serviceworker' in navigator) { navigator.serviceworker .register('/sw.js') .then(function() { console.log('service worker registered'); }); } // ...
ServiceWorkerGlobalScope: message event - Web APIs
// in the page being controlled if (navigator.serviceworker) { navigator.serviceworker.register('service-worker.js'); navigator.serviceworker.addeventlistener('message', event => { // event is a messageevent object console.log(`the service worker sent me a message: ${event.data}`); }); navigator.serviceworker.ready.then( registration => { registration.active.postmessage("hi service worker"); }); } the service worker can receive the message by listening to the message...
ServiceWorkerGlobalScope.onsync - Web APIs
this is triggered when a call to syncmanager.register is made from a service worker client page.
ServiceWorkerGlobalScope: pushsubscriptionchange event - Web APIs
self.addeventlistener("pushsubscriptionchange", event => { event.waituntil(swregistration.pushmanager.subscribe(event.oldsubscription.options) .then(subscription => { return fetch("register", { method: "post", headers: { "content-type": "application/json" }, body: json.stringify({ endpoint: subscription.endpoint }) }); }) ); }, false); when a pushsubscriptionchange event arrives, indicating that the subscription has expired, we resubscribe by calling the push manager's subscribe() method.
ServiceWorkerRegistration.active - Web APIs
an active worker controls a serviceworkerclient if the client's url falls within the scope of the registration (the scope option set when serviceworkercontainer.register is first called.) note: this feature is available in web workers.
ServiceWorkerRegistration.getNotifications() - Web APIs
example navigator.serviceworker.register('sw.js'); var options = { tag : 'user_alerts' }; navigator.serviceworker.ready.then(function(registration) { registration.getnotifications(options).then(function(notifications) { // do something with your notifications }) }); specifications specification status comment notifications apithe definition of 'serviceworkerregistration.getnotifications()' in that spe...
ServiceWorkerRegistration.index - Web APIs
syntax var a contentindex object = serviceworkerregistration.index; value a contentindex object examples you can access the property from either your main script or the registered service worker.
ServiceWorkerRegistration.pushManager - Web APIs
} navigator.serviceworker.register('serviceworker.js').then( function(serviceworkerregistration) { serviceworkerregistration.pushmanager.subscribe().then( function(pushsubscription) { console.log(pushsubscription.subscriptionid); console.log(pushsubscription.endpoint); // the push subscription details needed by the application // server are now available, and can be sent to it using, ...
ServiceWorkerRegistration.scope - Web APIs
the service worker must be on the same origin as the document that registers the serviceworker.
ServiceWorkerRegistration.showNotification() - Web APIs
examples navigator.serviceworker.register('sw.js'); function shownotification() { notification.requestpermission(function(result) { if (result === 'granted') { navigator.serviceworker.ready.then(function(registration) { registration.shownotification('vibration sample', { body: 'buzz!
ServiceWorkerRegistration.update() - Web APIs
example the following simple example registers a service worker example then adds an event handler to a button so you can explicitly update the service worker whenever desired: if ('serviceworker' in navigator) { navigator.serviceworker.register('/sw-test/sw.js', {scope: 'sw-test'}).then(function(registration) { // registration worked console.log('registration succeeded.'); button.onclick = function() { registration.upda...
Touch.clientX - Web APIs
WebAPITouchclientX
// register touchstart and touchend listeners for element 'source' var src = document.getelementbyid("source"); var clientx, clienty; src.addeventlistener('touchstart', function(e) { // cache the client x/y coordinates clientx = e.touches[0].clientx; clienty = e.touches[0].clienty; }, false); src.addeventlistener('touchend', function(e) { var deltax, deltay; // compute the change in x and y coor...
Touch.clientY - Web APIs
WebAPITouchclientY
// register touchstart and touchend listeners for element 'source' var src = document.getelementbyid("source"); var clientx, clienty; src.addeventlistener('touchstart', function(e) { // cache the client x/y coordinates clientx = e.touches[0].clientx; clienty = e.touches[0].clienty; }, false); src.addeventlistener('touchend', function(e) { var deltax, deltay; // compute the change in x and y coor...
Touch.pageX - Web APIs
WebAPITouchpageX
// register a touchmove listeners for the 'source' element var src = document.getelementbyid("source"); src.addeventlistener('touchmove', function(e) { // iterate through the touch points that have moved and log each // of the pagex/y coordinates.
Touch.pageY - Web APIs
WebAPITouchpageY
// register a touchmove listeners for the 'source' element var src = document.getelementbyid("source"); src.addeventlistener('touchmove', function(e) { // iterate through the touch points that have moved and log each // of the pagex/y coordinates.
Touch.radiusX - Web APIs
WebAPITouchradiusX
the following simple code snippet, registers a single handler for the touchstart, touchmove and touchend events.
Touch.screenX - Web APIs
WebAPITouchscreenX
// register a touchstart listeners for the 'source' element var src = document.getelementbyid("source"); src.addeventlistener('touchstart', function(e) { // iterate through the touch points and log each screenx/y coordinate.
Touch.target - Web APIs
WebAPITouchtarget
// register a touchmove listener for the 'source' element var src = document.getelementbyid("source"); src.addeventlistener('touchstart', function(e) { // iterate through the touch points that were activiated // for this element.
Multi-touch interaction - Web APIs
// log events flag var logevents = false; // touch point cache var tpcache = new array(); register event handlers event handlers are registered for all four touch event types.
WebGLRenderingContext.getExtension() - Web APIs
var canvas = document.getelementbyid('canvas'); gl = canvas.getcontext('webgl'); gl.getextension('webgl_lose_context').losecontext(); webgl extensions extensions for the webgl api are registered in the webgl extension registry.
WebGLRenderingContext.getSupportedExtensions() - Web APIs
webgl extensions extensions for the webgl api are registered in the webgl extension registry.
Signaling and video calling - Web APIs
the server supports several message types to handle tasks, such as registering new users, setting usernames, and sending public chat messages.
WebRTC API - Web APIs
rtcidentityproviderregistrar registers an identity provider (idp).
Writing WebSocket servers - Web APIs
are registered at the iana websocket protocol registry.
WebXR performance guide - Web APIs
they can be thought of as being similar to the registers in a microprocessor: a limited set of memory storage slots for specific kinds of data or use cases.
Functions and classes available to Web Workers - Web APIs
serviceworkerregistration you can register a service worker from inside a standard worker, and use associated functionality.
Using Web Workers - Web APIs
var onmessage and function onmessage will define global properties with those names, but they will not register the function to receive messages sent by the web page that created the worker).
Window.captureEvents() - Web APIs
the window.captureevents() method registers the window to capture all events of the specified type.
Window.isSecureContext - Web APIs
if (window.issecurecontext) { // page is a secure context so service workers are now available navigator.serviceworker.register("/offline-worker.js").then(function () { ...
Window.ondragdrop - Web APIs
WebAPIWindowondragdrop
syntax window.ondragdrop = funcref; window.addeventlistener("dragdrop", funcref, usecapturing); funcref the event handler function to be registered.
Window.sidebar - Web APIs
WebAPIWindowsidebar
returns a sidebar object which contains several methods for registering add-ons with the browser.
XRSession.onvisibilitychange - Web APIs
note: the visibility state of xr session affects the frame loop so callbacks registered via xrsession.requestanimationframe() might not be called.
HTML To MSAA - Accessibility
map html element role name value states relations actions events notes a role_system_ link n/a value of @href attribute state_system_ selectable if @name attribute is presented state_system_ linked if @href attribute is presented or click event listener is registered state_system_ traversed if link is traversed n/a "jump" if @href is valid n/a br role_system_ whitespace '\n' (new line char) state_system_ readonly n/a n/a n/a button role_system_ pushbutton from child nodes n/a state_system_ focusable state_system_ default if @type attribute has value "submit" n/a "press" n/a caption bstr role n/a n/a n/a description_for (0x100f), points t...
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
accessibility aids use the win32 call setwineventhook() to register as a listener for these events.
Text labels and names - Accessibility
examples the title for the reference article about the <title> element is as follows: <title>&lt;title&gt;: the document title element - html: hypertext markup language</title> another example might look like so: <title>fill in your details to register — mygov services</title> to help the user, you can update the page title value to reflect significant page state changes (such as form validation problems): <title>2 errors — fill in your details to register — mygov services</title> see also <title> embedded content must be labeled make sure that elements that embed content have a title attribute that describes the embedded content...
Testing media queries programmatically - CSS: Cascading Style Sheets
esult of the query by looking at the value of its matches property: if (mediaquerylist.matches) { /* the viewport is currently in portrait orientation */ } else { /* the viewport is not currently in portrait orientation, therefore landscape */ } receiving query notifications if you need to be aware of changes to the evaluated result of the query on an ongoing basis, it's more efficient to register a listener than to poll the query's result.
paint() - CSS: Cascading Style Sheets
WebCSSpaint
syntax paint(workletname, parameters) where: workletname the name of the registered worklet.
Mutation events - Developer guides
nction (removed) { if (isdescendant(element, removed)) { callback(); // allow garbage collection observer.disconnect(); observer = undefined; } }); }); }); observer.observe(document, { childlist: true, subtree: true }); }; usage you can register a listener for mutation events using element.addeventlistener as follows: element.addeventlistener("domnodeinserted", function (event) { // ...
Event developer guide - Developer guides
WebGuideEvents
the custom events page describes how the event code design pattern can be used in custom code to define new event types emitted by user objects, register listener functions to handle those events, and trigger the events in user code.
HTML5 - Developer guides
WebGuideHTMLHTML5
web-based protocol handlers you can now register web applications as protocol handlers using the navigator.registerprotocolhandler() method.
User input and controls - Developer guides
need to add event listeners and specify handler functions, which will be called when the event gets fired: element.addeventlistener("touchstart", handlestart, false);
 element.addeventlistener("touchcancel", handlecancel, false);
 element.addeventlistener("touchend", handleend, false);
 element.addeventlistener("touchmove", handlemove, false); where element is the dom element you want to register the touch events on.
<area> - HTML: Hypertext Markup Language
WebHTMLElementarea
the values and their semantics will be registered by some authority that might have meaning to the document author.
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
WebHTMLElementaudio
you can use code like this: var elem = document.queryselector("audio"); elem.audiotracklist.onaddtrack = function(event) { trackeditor.addtrack(event.track); }; elem.audiotracklist.onremovetrack = function(event) { trackeditor.removetrack(event.track); }; this code watches for audio tracks to be added to and removed from the element, and calls a hypothetical function on a track editor to register and remove the track from the editor's list of available tracks.
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
WebHTMLElementinput
if you don't do this, and a custom validity was previously set, the input will register as invalid, even if it current contains a valid value on submission.
<video>: The Video Embed element - HTML: Hypertext Markup Language
WebHTMLElementvideo
you can use code like this: var elem = document.queryselector("video"); elem.audiotracklist.onaddtrack = function(event) { trackeditor.addtrack(event.track); }; elem.audiotracklist.onremovetrack = function(event) { trackeditor.removetrack(event.track); }; this code watches for audio tracks to be added to and removed from the element, and calls a hypothetical function on a track editor to register and remove the track from the editor's list of available tracks.
Global attributes - HTML: Hypertext Markup Language
is allows you to specify that a standard html element should behave like a registered custom built-in element (see using custom elements for more details).
HTML: Hypertext Markup Language
WebHTML
registering and logging in, sending feedback, buying products, and more.
MIME types (IANA media types) - HTTP
discrete types the discrete types currently registered with the iana are: applicationlist at iana any kind of binary data that doesn't fall explicitly into one of the other types; either data that will be executed or interpreted in some way or binary data that requires a specific application or category of application to use.
Cross-Origin Resource Sharing (CORS) - HTTP
WebHTTPCORS
e fetch spec defines as a “cors-safelisted request-header”, which are: accept accept-language content-language content-type (but note the additional requirements below) dpr downlink save-data viewport-width width the only allowed values for the content-type header are: application/x-www-form-urlencoded multipart/form-data text/plain no event listeners are registered on any xmlhttprequestupload object used in the request; these are accessed using the xmlhttprequest.upload property.
Accept-Ranges - HTTP
though bytes is the only range unit formally defined by rfc 7233, additional range units may be registered in the http range unit registry.
CSP: worker-src - HTTP
examples violation cases given this csp header: content-security-policy: worker-src https://example.com/ worker, sharedworker, serviceworker are blocked and won't load: <script> var blockedworker = new worker("data:application/javascript,..."); blockedworker = new sharedworker("https://not-example.com/"); navigator.serviceworker.register('https://not-example.com/sw.js'); </script> specifications specification status comment content security policy level 3the definition of 'worker-src' in that specification.
An overview of HTTP - HTTP
WebHTTPOverview
the client browser automatically converts the messages that arrive on the http stream into appropriate event objects, delivering them to the event handlers that have been registered for the events' type if known, or to the onmessage event handler if no type-specific event handler was established.
About JavaScript - JavaScript
javascript® is a trademark or registered trademark of oracle in the u.s.
Memory Management - JavaScript
v8 engine flags the max amount of available heap memory can be increased with a flag: node --max-old-space-size=6000 index.js we can also expose the garbage collector for debugging memory issues using a flag and the chrome debugger: node --expose-gc --inspect index.js see also ibm article on "memory leak patterns in javascript" (2007) kangax article on how to register event handler and avoid memory leaks (2010) performance ...
Intl - JavaScript
ndi (language) "de-at": german (language) as used in austria (region) "zh-hans-cn": chinese (language) written in simplified characters (script) as used in china (region) "en-emodeng": english (language) in the "early modern english" dialect (variant) the subtags identifying languages, scripts, regions (including countries), and (rarely used) variants in unicode bcp 47 locale identifiers are registered in the iana language subtag registry.
Promise.prototype.then() - JavaScript
receive "foobar", register a callback function to work on that string // and print it to the console, but not before returning the unworked on // string to the next then .then(function(string) { settimeout(function() { string += 'baz'; console.log(string); // foobarbaz }, 1) return string; }) // 3.
Symbol.keyFor() - JavaScript
examples using keyfor var globalsym = symbol.for('foo'); // create a new global symbol symbol.keyfor(globalsym); // "foo" var localsym = symbol(); symbol.keyfor(localsym); // undefined // well-known symbols are not symbols registered // in the global symbol registry symbol.keyfor(symbol.iterator) // undefined specifications specification ecmascript (ecma-262)the definition of 'symbol.keyfor' in that specification.
JavaScript
both "java" and "javascript" are trademarks or registered trademarks of oracle in the u.s.
Populating the page: how browsers work - Web Performance
the server registers this as missing acks.
Progressive web app structure - Progressive web apps (PWAs)
lace(/slug/g,games[i].slug) .replace(/name/g,games[i].name) .replace(/author/g,games[i].author) .replace(/twitter/g,games[i].twitter) .replace(/website/g,games[i].website) .replace(/github/g,games[i].github); entry = entry.replace('<a href=\'http:///\'></a>','-'); content += entry; }; document.getelementbyid('content').innerhtml = content; next, it registers a service worker: if('serviceworker' in navigator) { navigator.serviceworker.register('/pwa-examples/js13kpwa/sw.js'); }; the next code block requests permission for notifications when a button is clicked: var button = document.getelementbyid("notifications"); button.addeventlistener('click', function(e) { notification.requestpermission().then(function(result) { if(result === ...
How to make PWAs installable - Progressive web apps (PWAs)
requirements to make the web site installable, it needs the following things in place: a web manifest, with the correct fields filled in the web site to be served from a secure (https) domain an icon to represent the app on the device a service worker registered, to allow the app to work offline (this is required only by chrome for android currently) currently, only the chromium-based browsers such as chrome, edge, and samsung internet require the service worker.
Structural overview of progressive web apps - Progressive web apps (PWAs)
lace(/slug/g,games[i].slug) .replace(/name/g,games[i].name) .replace(/author/g,games[i].author) .replace(/twitter/g,games[i].twitter) .replace(/website/g,games[i].website) .replace(/github/g,games[i].github); entry = entry.replace('<a href=\'http:///\'></a>','-'); content += entry; }; document.getelementbyid('content').innerhtml = content; then it registers a service worker: if ("serviceworker" in navigator) { navigator.serviceworker.register("/pwa-examples/js13kpwa/sw.js"); } after that, the app adds a handler for clicks on a button whose id is notifications; this handler requests permission to send notifications to the user, then generates and sends a random notification.
Features restricted to secure contexts - Web security
registerprotocolhandler() restricted to secure contexts in firefox 62.
Secure contexts - Web security
if (window.issecurecontext) { // page is a secure context so service workers are now available navigator.serviceworker.register("/offline-worker.js").then(function () { ...
Subdomain takeovers - Web security
(for "blog", you can substitute "e-commerce platform", "customer service platform", or any other "cloud-based" virtual hosting scenario.) the process you go through might look like this: you register the name "blog.example.com" with a domain registrar.
Tutorials
registering and logging in, sending feedback, buying products, and more.