Search completed in 2.15 seconds.
115 results for "unregister":
Your results are loading. Please wait...
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.
...there is no need to all unregister in your cleanup callback.
...And 6 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
autoUnregister
this content is now available at nsicomponentregistrar.autounregister().
unregisterFactory
this content is now available at nsicomponentregistrar.unregisterfactory().
unregisterFactoryLocation
this content is now available at nsicomponentregistrar.unregisterfactorylocation().
unregisterProvider
this content is now available at nsidirectoryservice.unregisterprovider().
unregisterSelf
this content is now available at nsimodule.unregisterself().
platform/xpcom - Archive of obsolete content
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 exports a class called factory which implements the nsifactory interface.
... contractidtocid('@me.org/helloworld'); var wrapper = components.classesbyid[id].createinstance(ci.nsisupports); the xpcom module exports a function factorybycontract to simplify this technique: var wrapper = xpcom.factorybycontract('@me.org/helloworld').createinstance(ci.nsisupports); registration by default, factories are registered and unregistered automatically.
... to learn more about this, see registering and unregistering.
...And 12 more matches
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 af...
...ile, 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.
... autounregister() unregister a component file or all component files in a directory.
...And 7 more matches
CustomizableUI.jsm
areas are registered using the registerarea method and unregistered using the unregisterarea method.
... onareanodeunregistered(aarea, anode, areason) fired when an area's dom node is unregistered.
... aarea is the area for which a node was unregistered, anode the dom node which was unregistered, and areason indicates whether the area as a whole was unregistered (reason_area_unregistered), or whether a window closed (reason_window_closed).
...And 5 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.
...note: pages will not be automatically unregistered when private browsing mode is entered or exited.
... therefore, consumers must unregister or register themselves.
...And 4 more matches
Index - Web APIs
WebAPIIndex
1469 geolocation.clearwatch() api, geolocation, geolocation api, method, needsexample, reference, secure context the geolocation.clearwatch() method is used to unregister location/error monitoring handlers previously installed using geolocation.watchposition().
... 3202 pushmanager.unregister() api, deprecated, method, reference, simple push api 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.
...And 4 more matches
Creating the Component Code
ns_imethod registerself(nsicomponentmanager *acompmgr, nsifile *alocation, const char *aloaderstr, const char *atype) = 0; ns_imethod unregisterself(nsicomponentmanager *acompmgr, nsifile *alocation, const char *aloaderstr) = 0; registerself is called when a component is first registered with xpcom.
...note that whatever you do in registerself should be undone in unregisterself.
... the many faces of the xpcom component manager the three core component management interfaces, nsicomponentmanager, nsiservicemanager, and nsicomponentregistrar, are described below: nsicomponentmanager - creates objects and gets implementation details about objects nsiservicemanager - provides access to singleton objects and discovers singleton state nsicomponentregistrar - registers and unregisters factories and components; handles autoregistration and the discovery and enumeration of registered components.
...And 3 more matches
nsIWindowMediator
void unregisterwindow(in nsixulwindow awindow); native code only!
... example: of window listener object and how to register then unregister.
... removelistener() unregister a listener of window status changes.
...And 3 more matches
DevTools API - Firefox Developer Tools
unregistertool(tool) unregisters the given tool and removes it from all toolboxes.
... parameters: tool {tooldefinition|string} - the tool definition object or the id of the tool to unregister.
... unregistertheme(theme) unregisters the given theme.
...And 3 more matches
FinalizationRegistry - JavaScript
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.
... the registry only keeps a weak reference to the unregister token.
... it's common to use the object itself as the unregister token, which is just fine: registry.register(theobject, "some value", theobject); // ...some time later, if you don't care about `theobject` anymore...
...And 3 more matches
Index
MozillaTechXPCOMIndex
418 autounregister no summary!
... 426 unregisterfactory no summary!
... 427 unregisterfactorylocation no summary!
...And 2 more matches
nsIErrorService
@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.
... unregistererrorstringbundle() unregisters a string bundle url for an error module.
... void unregistererrorstringbundle( in short errormodule ); parameters errormodule the module for which the string bundle is to be unregistered.
...And 2 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 gets the total size of explicit memory allocations, both at the operating system level (for example, via mmap, virtualalloc) and at the heap level (...
... unregistermultireporter() stops sending memory multi-reporter notifications to the specified object.
... void unregistermultireporter( in nsimemorymultireporter reporter ); parameters reporter an object implementing the nsimemorymultireporter interface which provides memory usage information for a given code area.
...And 2 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.
...); compreg.registerfactorylocation(class_id, class_name, contract_id, afilespec, alocation, atype); var catman = components.classes["@mozilla.org/categorymanager;1"] .getservice(nsicategorymanager); 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); }, canunlo...
...terfaces.nsicommandline); var test = cmdline.handleflagwithparam("test", false); alert("test = " + test); }, register: function() { var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); observerservice.addobserver(this, "commandline-args-changed", false); }, unregister: function() { var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); observerservice.removeobserver(this, "commandline-args-changed"); } } var observer = new commandlineobserver(); // because we haven't yet registered a commandlineobserver when the application is // launche...
...var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); observerservice.notifyobservers(window.arguments[0], "commandline-args-changed", null); addeventlistener("unload", observer.unregister, false); finally, add a reference in your application window to the observer: chrome/content/window.xul <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="main" title="&window.title;" windowtype="xulmine" style="width: 300px; height: 350px;" persist="screenx screeny width height sizemode"> <script type="applica...
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 around...
...please see the corresponding documentation of these services on how to properly unregister/remove your observers and components during unload.
nsIAppShellService
ineservice 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.
... unregistertoplevelwindow() remove a window from the application's window registry.
... note: this method will not automatically attempt to quit the application when the last window is unregistered.
... void unregistertoplevelwindow( in nsixulwindow awindow ); parameters awindow the window to register.
nsIBrowserHistory
i); 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 boolean 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.
... unregisteropenpage() obsolete since gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) mark a page as no longer being open (either by closing the window or tab, or by navigating away from that page).
... note: this method was an alias for moziplacesautocomplete.unregisteropenpage(), which still exists and can be used instead.
... void unregisteropenpage( in nsiuri auri ); parameters auri the page to unregister as an open page.
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.
...call unregisterprovider() to force the directory service to relinquish ownership of a particular provider instance.
... unregisterprovider() unregister a provider that was previously registered with the directory service.
... void unregisterprovider( in nsidirectoryserviceprovider prov ); parameters prov the nsidirectoryserviceprovider to unregister from the service.
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.
... unregisterreceiver() this unregisters a callback previously registered with registerreceiver() void unregisterreceiver( in astring amessagename, in jsval areceiver ); parameters amessagename the name of the message on which the callback should no longer be triggered.
... unregisterreceivers() this unregisters all callbacks previously registered with registerreceiver() for a particular message.
... void unregisterreceivers( in astring amessagename ); parameters amessagename the name of the message to unregister all callbacks from.
nsIProtocolProxyService
; 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.
... unregisterfilter() this method may be used to unregister a proxy filter instance.
... all filters will be automatically unregistered at xpcom shutdown.
... void unregisterfilter( in nsiprotocolproxyfilter afilter ); parameters afilter the nsiprotocolproxyfilter instance to be unregistered.
Using the CSS properties and values API - Web APIs
notice that with the registered property the transition works, but that it doesn't with the unregistered property!
... .registered { --registered: #c0ffee; background-image: linear-gradient(to right, #fff, var(--registered)); transition: --registered 1s ease-in-out; } .registered:hover, .registered:focus { --registered: #b4d455; } .unregistered { --unregistered: #c0ffee; background-image: linear-gradient(to right, #fff, var(--unregistered)); transition: --unregistered 1s ease-in-out; } .unregistered:hover, .unregistered:focus { --unregistered: #b4d455; } <button class="registered">background registered</button> <button class="unregistered">background not registered</button> .registered { --registered: #c0ffee; background-image: linear-gradient(to right, #fff, var(--registered)); transition: --registered 1s ease-in-out; } .registered:hover, .registered:focus { --registered: #b4d455; ...
...} .unregistered { --unregistered: #c0ffee; background-image: linear-gradient(to right, #fff, var(--unregistered)); transition: --unregistered 1s ease-in-out; } .unregistered:hover, .unregistered:focus { --unregistered: #b4d455; } button { height: 40vh; display: block; width: 100%; font-size: 3vw; } window.css.registerproperty({ name: '--registered', syntax: '<color>', inherits: false, initialvalue: 'red', }); while not functionally accurate, a good way to think about the difference between the unregistered property in the above example and the registered property is the difference between a <custom-ident> and a number when trying to animate height.
...with an unregisterd property, the browser likewise doesn't know what the value may be until it's calculated, and because of that, it can't set up a transition from one value to another.
FinalizationRegistry.prototype.register() - JavaScript
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.
...if not provided, the target cannot be unregistered.
... following registers the target object referenced by target, passing in the held value "some value" and passing the target object itself as the unregistration token: registry.register(target, "some value", target); the following registers the target object referenced by target, passing in another object as the held value, and not passing in any unregistration token (which means target can't be unregistered): registry.register(target, {"useful": "info about target"}); specifications specification weakrefsthe definition of 'finalizationregistry.prototype.register' in that specification.
TPS Tests
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.
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.
nsIConsoleService
consolemessage 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.
...(this also works before gecko 19.) unregisterlistener() deregisters a listener.
... void unregisterlistener( in nsiconsolelistener listener ); parameters listener the nsiconsolelistener to remove.
nsIModule
supports 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.
... unregisterself() when the nsimodule is being unregistered, this method will be called so that any unregistration can be preformed.
... void unregisterself( in nsicomponentmanager acompmgr, in nsifile alocation, in string aloaderstr ); parameters acompmgr the global component manager.
nsIMsgSearchSession
on.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); void addscopeterm(in nsmsgsearchscopevalue scope, in nsimsgfolder fo...
... 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.
nsIStyleSheetService
eate 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_sheet 2 methods loadandregistersheet() synchronously loads a style sheet from sheeturi and adds it to the list of user or agent style sheets.
...unregistersheet() remove the style sheet at sheeturi from the list of style sheets specified by type.
...void unregistersheet( in nsiuri sheeturi, in unsigned long type ); parameters sheeturi uri of the stylesheet to unregister.
nsIWindowWatcher
twindowbyname(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 returning it on demand.
... unregisternotification() 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 unregisternotification( in nsiobserver aobserver ); parameters aobserver the nsiobserver to be removed.
Setting HTTP request headers
unregistering you should unregister the observer on shutdown.
...to unregister the observer use nsiobserverservice.removeobserver as follows: observerservice.removeobserver(httprequestobserver, "http-on-modify-request"); all-in-one example here is a slightly different version of our httprequestobserver object.
...est") { var httpchannel = subject.queryinterface(ci.nsihttpchannel); httpchannel.setrequestheader("x-hello", "world", false); } }, get observerservice() { return cc["@mozilla.org/observer-service;1"] .getservice(ci.nsiobserverservice); }, register: function() { this.observerservice.addobserver(this, "http-on-modify-request", false); }, unregister: function() { this.observerservice.removeobserver(this, "http-on-modify-request"); } }; this object has a convenience register() and unregister() methods, so in order to activate it you just need to call: httprequestobserver.register(); you should also remember to unregister the observer at shutdown: httprequestobserver.unregister(); and that's it.
ContentIndex - Web APIs
contentindex.delete unregisters an item from the currently indexed content.
...of links to the content const listelem = document.createelement('ul'); for (const entry of entries) { const listitem = document.createelement('li'); const anchorelem = document.createelement('a'); anchorelem.innertext = entry.title; anchorelem.setattribute('href', entry.url); listelem.append(listitem); } readinglistelem.append(listelem); } } unregistering indexed content below is an asynchronous function, that removes an item from the content index.
... 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); } all the above methods are available within the scope of the service worker.
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.
... pushregistrationmanager.unregister() returns a promise that resolves to a pushregistration with details of the unregistered registration.
... samsung internet android no support nounregister experimentaldeprecatedchrome no support noedge no support nofirefox ?
widget - Archive of obsolete content
removelistener(type, listener) unregisters an event listener from the widget.
... removelistener(type, listener) unregisters an event listener from the widget view.
frame/hidden-frame - Archive of obsolete content
remove unregisters a frame, unloading any content that was loaded in it.
... parameters hiddenframe : hiddenframe the frame to add remove(hiddenframe) unregister a hidden frame, unloading any content that was loaded in it.
Preferences - Archive of obsolete content
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": ...
... foreach(function (pref_leaf_name) { that._callback(that._branch, pref_leaf_name); }); } }; preflistener.prototype.unregister = function() { if (this._branch) this._branch.removeobserver('', this); }; var mylistener = new preflistener( "extensions.myextension.", function(branch, name) { switch (name) { case "pref1": // extensions.myextension.pref1 was changed break; case "pref2": // extensions.myextension.pref2 was changed break; } } ); mylistener.registe...
Custom about: URLs - Archive of obsolete content
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.unregisterfactory(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.
...ses["@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); } } ...
Jetpack Processes - Archive of obsolete content
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.
XPCOM Objects - Archive of obsolete content
var countermodule = { // registerself, unregisterself, getclassobject, canunload }; the only thing you may need to change here is when you need to use the category manager.
... the add and delete calls to the category manager would have to be done in the registerself and unregisterself methods: registerself : function(acompmgr, alocation, aloaderstr, atype) { let categorymanager = cc[@mozilla.org/categorymanager;1].getservice(ci.nsicategorymanager); acompmgr.queryinterface(ci.nsicomponentregistrar); acompmgr.registerfactorylocation( class_id, class_name, contract_id, alocation, aloaderstr, atype); categorymanager.addcategoryentry( "content-policy", ...
Using the Stylesheet Service - Archive of obsolete content
"@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ios.newuri("chrome://myext/content/myext.css", null, null); if(!sss.sheetregistered(uri, sss.user_sheet)) sss.loadandregistersheet(uri, sss.user_sheet); removing a previously registered stylesheet if you wish to remove a stylesheet that you previously registered, simply use the unregistersheet method.
...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 u = ios.newuri("chrome://myext/content/myext.css", null, null); if(sss.sheetregistered(u, sss.user_sheet)) sss.unregistersheet(u, sss.user_sheet); registering stylesheets on startup via the category manager stylesheets may also be registered on startup via the agent-style-sheets and user-style-sheets categories.
Modularization techniques - Archive of obsolete content
nsifactory *afactory, prbool areplace); // manually registry a dynamically loaded factory for a class static nsresult registerfactory(const nscid &aclass, const char *alibrary, prbool areplace, prbool apersist); // manually unregister a factory for a class static nsresult unregisterfactory(const nscid &aclass, nsifactory *afactory); // manually unregister a dynamically loaded factory for a class static nsresult unregisterfactory(const nscid &aclass, const char *alibrary); // unload dynamically loaded factories that are not in use static nsresult ...
... extern "c" ns_export nsresult nsregisterself(const char *path); extern "c" ns_export nsresult nsunregisterself(const char *path); this allows a dll to register and unregister all its factories.
XULRunner 1.8.0.4 Release Notes - Archive of obsolete content
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
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
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
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 2.0 Release Notes - Archive of obsolete content
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.
Monitoring plugins - Archive of obsolete content
clean up to unregister your class with the observer service - when you no longer want to be listening to runtime notifications - your class must include an unregister method that contains the following code: var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); observerservice.removeobserver(this, "experimental-notify...
... var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); observerservice.addobserver(this, "experimental-notify-plugin-call", false); this.registered = true; } }, //unregisters from the observer services unregister: function() { if (this.registered == true) { var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); observerservice.removeobserver(this, "experimental-notify-plugin-call"); this.registered = false; } } } ...
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.
Command line options
--unregister-global unregisters xulrunner for all users.
... --unregister-user unregisters xulrunner for a single user.
Webapps.jsm
erinterappconnectionsforentrypoint: function(amanifest, aapp,) _registersystemmessages: function(amanifest, aapp) _registerinterappconnections: function(amanifest, aapp) _createactivitiestoregister: function(amanifest, aapp, aentrypoint, arunupdate) _registeractivitiesforapps: function(aappstoregister, arunupdate) _registeractivities: function(amanifest, aapp, arunupdate) _createactivitiestounregister: 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: func...
...tion(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, adata) dogetlist: function() doexport: function(amsg, amm) doimport: function(amsg, amm) doextractmanifest: function(amsg, amm) dolaunch: function (adata, amm) launch: function launch(amanifesturl, astartpoint, atimestamp, aonsuccess, aonfailure) close: function close(aapp) canceldownload: function canceldownload(amanifesturl, aerror) startofflinecachedownload: function(amanifest, aapp, aprofiledir, aisupdate) computemanifesthash: function(amanifest) updateapphandlers: f...
Component Internals
an application, for example, could provide a "registration-less" component directory whose components are automatically registered at startup and unregistered at shutdown.
... to register, unregister, load and manage various component types, xpcom abstracts the interface between the xpcom component and xpcom with the component loader.
nsIHTMLEditor
removealldefaultproperties() unregisters all default style properties with the editor.
... removedefaultproperty() unregisters a default style property with the editor.
nsIObserver
}, register: function() { var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); observerservice.addobserver(this, "mytopicid", false); }, unregister: function() { var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); observerservice.removeobserver(this, "mytopicid"); } } instantiation - this should be fired once you're ready to start observing (for example a window's load event).
... observer.unregister(); "get everything" - note that "*" is an acceptable value (be careful with this, because it observes many events, and can degrade performance).
nsIRadioInterfaceLayer
ack(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 pdptype); 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.
...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 ...
about:debugging (before Firefox 68) - Firefox Developer Tools
unregistering service workers new in firefox 48.
... starting in firefox 48, you'll see a link named "unregister" next to each registered service worker: click the link to unregister the service worker.
CSS.registerProperty() - Web APIs
notice that with the registered property the transition works, but that it doesn't with the unregistered property!
... .registered { --my-color: #c0ffee; background-image: linear-gradient(to right, #fff, var(--my-color)); transition: --my-color 1s ease-in-out; } .registered:hover, .registered:focus { --my-color: #b4d455; } .unregistered { --unregistered: #c0ffee; background-image: linear-gradient(to right, #fff, var(--unregistered)); transition: --unregistered 1s ease-in-out; } .unregistered:hover, .unregistered:focus { --unregistered: #b4d455; } button { font-size: 3vw; } we can add these styles to some buttons: <button class="registered">background registered</button> <button class="unregistered">background not registered</button> specifications specification status comment css properties and values api level 1the definition of 'the registerproperty() function'...
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.
Content Index API - Web APIs
of links to the content const listelem = document.createelement('ul'); for (const entry of entries) { const listitem = document.createelement('li'); const anchorelem = document.createelement('a'); anchorelem.innertext = entry.title; anchorelem.setattribute('href', entry.url); listelem.append(listitem); } readinglistelem.append(listelem); } } unregistering indexed content below is an asynchronous function, that removes an item from the content index.
... 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); } all the above methods are available within the scope of the service worker.
PushManager - Web APIs
pushmanager.unregister() unregisters and deletes a specified subscription endpoint.
... in the updated api, a subscription is unregistered by calling the pushsubscription.unsubscribe() method.
ServiceWorkerRegistration - Web APIs
serviceworkerregistration.unregister() unregisters the service worker registration and returns a promise.
... the service worker will finish any ongoing operations before it is unregistered.
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.
page-worker - Archive of obsolete content
removelistener(type, listener) unregisters an event listener from the page worker.
panel - Archive of obsolete content
removelistener(type, listener) unregisters an event listener from the panel.
simple-prefs - Archive of obsolete content
removelistener(prefname, listener) unregisters an event listener for the specified preference.
event/target - Archive of obsolete content
}); 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.
ui/sidebar - Archive of obsolete content
removelistener(type, listener) unregisters/removes an event listener from the sidebar.
Appendix F: Monitoring DOM changes - Archive of obsolete content
* @optional @default document * * @returns {function} a function which may be called to unregister the * listener.
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.
Observer Notifications - Archive of obsolete content
therefore, the registered observer is unregistered when the browser window is unloaded.
XPJS Components Proposal - Archive of obsolete content
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.
XULRunner 1.8.0.1 Release Notes - Archive of obsolete content
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.
Deploying XULRunner - Archive of obsolete content
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.
Introduction to events - Learn web development
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.
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 a Login Manager storage module
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.
Communicating with frame scripts
(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.nsiobserverservice); observerservice.removeobserver(this, "message-manager-disconnect"); } } var observer = new myobserver(); observer.register(); ...
Performance
additionally the example above does not clean unregister itself, thus leaking objects each time a tab is closed.
How to implement a custom autocomplete search component
= 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); acompmgr.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)) r...
IME handling guide
when composition completely ends, it's unregistered from the list (and released automatically).
TypeListener
typelisteners can be registered with addtypelistener() and will then receive notification as addontype are registered and unregistered.
XPCOMUtils.jsm
pre-unregistration callback the pre-unregistration callback passed to generatemodule() should have the following signature: preunregister( nsicomponentmanager compmgr, nsifile filespec, componentsarray ); parameters compmgr the nsicomponentmanager instance to use for managing the component.
NSS functions
er 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 nssbase64decoder_destroy mxr 3.2 and later nssbase64decoder_update mxr 3.2 and later ...
Utility functions
er 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 nssbase64decoder_destroy mxr 3.2 and later nssbase64decoder_update mxr 3.2 and later ...
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::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_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_RemoveRootRT
unregisters a pointer to a gc thing so that it is no longer a member of the garbage collector's root set.
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.
Starting WebLock
registering for notifications the nsiobserverservice interface has methods for registering and unregistering an nsiobserver object.
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).
nsIComponentManager
removebootstrappedmanifestlocation() unregisters the chrome.manifest file previously registered with the addbootstrappedmanifestlocation() method.
nsIContentPrefService2
removeobserverforname() unregisters an observer for the given name.
nsIDragDropHandler
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.
nsIHttpActivityDistributor
netwerk/protocol/http/nsihttpactivityobserver.idlscriptable this interface is used to register and unregister clients that wish to observe http transport activity.
nsIHttpHeaderVisitor
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 = components.classes[ "@mozilla.org/observer-service;1" ].getservice( components.interfaces.nsiobserverservice ); observerservice.removeobserver( this, "http-on-examine-response" ); observerservice.removeobserver(this, "http-on-examine-cached-response"); }; see also nsihttpchannel ...
nsIObserverService
removeobserver() this method is called to unregister an observer for a particular topic.
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.
Address Book examples
} 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.
Debugging service workers - Firefox Developer Tools
unregister on the right-hand side of the service workers view there is an unregister button, which when pressed unregisters the service worker.
about:debugging - Firefox Developer Tools
unregistering service workers click the unregister button to unregister the service worker.
Geolocation.clearWatch() - Web APIs
the geolocation.clearwatch() method is used to unregister location/error monitoring handlers previously installed using geolocation.watchposition().
Geolocation.watchPosition() - Web APIs
the id can be passed to the geolocation.clearwatch() to unregister the handler.
PushManager.register() - Web APIs
note: if you do not need the url any more, please use pushmanager.unregister() to clean up after yourself.
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.
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.
Service Worker API - Web APIs
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.
Clear-Site-Data - HTTP
this includes storage mechanisms such as: localstorage (executes localstorage.clear), sessionstorage (executes sessionstorage.clear), indexeddb (for each database execute idbfactory.deletedatabase), service worker registrations (for each service worker registration, execute serviceworkerregistration.unregister), appcache, websql databases, filesystem api data, plugin data (flash via npp_clearsitedata).