Search completed in 1.83 seconds.
10 results for "nsILoadContext":
nsIContentPrefService2
MozillaTechXPCOMReferenceInterfacensIContentPrefService2
pass an nsiloadcontext to use storage appropriate to the context's useprivatebrowsing attribute: if useprivatebrowsing is true, temporary private-browsing storage is used, and otherwise permanent storage is used.
...method overview void addobserverforname(in astring name, in nsicontentprefobserver observer); void getbydomainandname(in astring domain, in astring name, in nsiloadcontext context, in nsicontentprefcallback2 callback); void getbysubdomainandname(in astring domain, in astring name, in nsiloadcontext context, in nsicontentprefcallback2 callback); nsicontentpref getcachedbydomainandname(in astring domain, in astring name, in nsiloadcontext context); void getcachedbysubdomainandname(in astring domain, in astring name, in ...
...nsiloadcontext context, out unsigned long len, [retval,array,size_is(len)] out nsicontentpref prefs); nsicontentpref getcachedglobal(in astring name, in nsiloadcontext context); void getglobal(in astring name, in nsiloadcontext context, in nsicontentprefcallback2 callback); void removealldomains(in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void removeallglobals(in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void removebydomain(in astring domain, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void removebydomainandname(in astring domain, in astring name, in nsiloadcontext context, [optional] in nsicontentprefcallback2 call...
...And 18 more matches
HTTP Cache
MozillaHTTP cache
diate memory structures: clear – after it returns, all entries are no longer accessible through the cache apis; the method is fast to execute and non-blocking in any way; the actual erase happens in background purgefrommemory – removes (schedules to remove) any intermediate cache data held in memory for faster access (more about the intermediate cache below) nsiloadcontextinfo distinguishes the scope of the storage demanded to open.
... //github.com/realityripple/uxp/blob/master/netwerk/base/public/nsiloadcontextinfo.idl it is a helper interface wrapping following four arguments into a single one: private-browsing boolean flag anonymous load boolean flag app id number (0 for no app) is-in-browser boolean flag helper functions to create nsiloadcontextinfo objects: c++ consumers: functions at loadcontextinfo.h exported header js consumers: resource://gre/modules/loadcontextinfo.jsm module methods two storage objects created with the same set of nsiloadcontextinfo arguments are identical, containing the same cache entries.
... two storage objects created with in any way different nsiloadcontextinfo arguments are strictly and completely distinct and cache entries in them do not overlap even when having the same uris.
...And 5 more matches
Tabbed browser - Archive of obsolete content
ArchiveAdd-onsTabbed browser
warning: this code should be updated to use nsiloadcontext instead of getinterface(components.interfaces.nsidomwindow).
...var domwindow = interfacerequestor.getinterface(components.interfaces.nsidomwindow); //not to be done anymore because: https://developer.mozilla.org/docs/updating_extensions_for_firefox_3.5#getting_a_load_context_from_a_request //instead do the loadcontext stuff below var loadcontext; try { loadcontext = interfacerequestor.getinterface(components.interfaces.nsiloadcontext); } catch (ex) { try { loadcontext = asubject.loadgroup.notificationcallbacks.getinterface(components.interfaces.nsiloadcontext); //in ff26 asubject.loadgroup.notificationcallbacks was null for me, i couldnt find a situation where it wasnt null, but whenever this was null, and i knew a loadcontext is supposed to be there, i found...
... that "interfacerequestor.getinterface(components.interfaces.nsiloadcontext);" worked fine, so im thinking in ff26 it doesnt use asubject.loadgroup.notificationcallbacks anymore, but im not sure } catch (ex2) { loadcontext = null; //this is a problem i dont know why it would get here } } /*end do not edit here*/ /*start - do all your edits below here*/ var url = ohttp.uri.spec; //can get url without needing loadcontext if (loadcontext) { var contentwindow = loadcontext.associatedwindow; //this is the html window of the page that just loaded //adomwindow this is the firefox window holding the tab var adomwindow = contentwindow.
...cks.queryinterface(ci.nsiinterfacerequestor); //var domwindow = interfacerequestor.getinterface(components.interfaces.nsidomwindow); //not to be done anymore because: https://developer.mozilla.org/docs/updating_extensions_for_firefox_3.5#getting_a_load_context_from_a_request //instead do the loadcontext stuff below try { loadcontext = interfacerequestor.getinterface(ci.nsiloadcontext); } catch (ex) { try { loadcontext = subject.loadgroup.notificationcallbacks.getinterface(ci.nsiloadcontext); } catch (ex2) {} } } catch (ex0) {} if (!loadcontext) { //no load context so dont do anything although you can run this, which is your old code //this probably means that its loading an ajax call or like a go...
nsIWebBrowserPersist
MozillaTechXPCOMReferenceInterfacensIWebBrowserPersist
rts afile); void savedocument(in nsidomdocument adocument, in nsisupports afile, in nsisupports adatapath, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awrapcolumn); void saveuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsiinputstream apostdata, in string aextraheaders, in nsisupports afile, in nsiloadcontext aprivacycontext); void saveprivacyawareuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsiinputstream apostdata, in string aextraheaders, in nsisupports afile, in boolean aisprivate); attributes attribute type description currentstate unsigned long current state of the persister object.
... void saveuri( in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsiinputstream apostdata, in string aextraheaders, in nsisupports afile, in nsiloadcontext aprivacycontext ); parameters auri uri to save to file.
...the window containing a link being saved) via a docshell that qis to nsiloadcontext.
... const flags = nsiwbp.persist_flags_replace_existing_files; obj_persist.persistflags = flags | nsiwbp.persist_flags_from_cache; var privacycontext = sourcewindow.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsiloadcontext); //save file to target obj_persist.saveuri(obj_uri,null,null,null,null,obj_targetfile,privacycontext); // starting with firefox 36 saveuri takes 8 parameters when called.
Limitations of chrome scripts
MozillaFirefoxMultiprocess LeftoversLimitations of chrome scripts
request") { var httpchannel = subject.queryinterface(ci.nsihttpchannel); var domwindow = httpchannel.notificationcallbacks.getinterface(ci.nsidomwindow); } } or this: observe: function (subject, topic, data) { if (topic == "http-on-modify-request") { var httpchannel = subject.queryinterface(ci.nsihttpchannel); var domwindow = httpchannel.notificationcallbacks.getinterface(ci.nsiloadcontext).associatedwindow; } } in multiprocess firefox these patterns will no longer work: the getinterface call will fail.
...it will return a dummy nsiloadcontext when asked, but any attempt to get a window out of it will fail.
...in an http observer, you can get the browser message manager for the window using code like this: observe: function (subject, topic, data) { if (topic == "http-on-modify-request") { var httpchannel = subject.queryinterface(ci.nsihttpchannel); var loadcontext = httpchannel.notificationcallbacks.getinterface(ci.nsiloadcontext); // topframeelement is the <browser> element var topframeelement = loadcontext.topframeelement; var browsermm = topframeelement.messagemanager; console.log("browsermm: " + browsermm); } } however, before firefox 38, this technique will not work if multiprocess firefox is disabled: specifically, topframeelement will be null.
nsITransferable
MozillaTechXPCOMReferenceInterfacensITransferable
void adddataflavor( in string adataflavor ); nsisupportsarray flavorstransferablecanexport( ); nsisupportsarray flavorstransferablecanimport( ); void getanytransferdata( out string aflavor, out nsisupports adata, out unsigned long adatalen ); void gettransferdata( in string aflavor, out nsisupports adata, out unsigned long adatalen ); void init(in nsiloadcontext acontext); boolean islargedataset( ); void removedataflavor( in string adataflavor ); void settransferdata( in string aflavor, in nsisupports adata, in unsigned long adatalen ); attributes attribute type description converter nsiformatconverter an nsiformatconverter instance which implements the code needed to convert data into and...
... void init( in nsiloadcontext acontext ); parameters acontext the load context associated with the transferable object.
... to get the appropriate load context in javascript callers, one needs to get to the document that the transferable corresponds to, and then get the load context from the document like this: var loadcontext = doc.defaultview.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsiloadcontext); in c++ callers, if you have the corresponding document, you can just call nsidocument.getloadcontext() to get to the load context object.
window/utils - Archive of obsolete content
ArchiveAdd-onsAdd-on SDKLow-Level APIswindow utils
parameters window : nsidomwindow returns nsidocshell getwindowloadingcontext(window) returns the nsiloadcontext.
... parameters window : nsidomwindow returns nsiloadcontext open(uri, options) this function is used to open top level (application) windows.
Supporting per-window private browsing - Archive of obsolete content
ArchiveMozillaSupporting per-window private browsing
} } catch(e) { components.utils.reporterror(e); return; } } obtaining an nsiloadcontext for privacy-sensitive apis some apis (such as nsitransferable and nsiwebbrowserpersist) take nsiloadcontext arguments that are used to determine whether they should be classed as private or not (for example, whether the uri being persisted by saveuri should be added to the permanent download history).
...as an example, if an add-on adds a context menu item that accesses an api that requires an nsiloadcontext, the most relevant window is the one that owns the element being targeted by the context menu (element.ownerdocument.defaultview).
Using the clipboard
MozillaTechXPCOMUsing the clipboard
initialize the transferring object with the nsiloadcontext obtained from the window that is the source of the clipboard data.
...for reading from the clipboard you can call the init method of the transferable with null as nsiloadcontext, but you have to call it.
Updating addons broken by private browsing changes - Archive of obsolete content
ArchiveAdd-onsUpdating addons broken by private browsing changes
nsicontentprefservice: getpref, setpref, haspref, hascachedpref, removepref, removegroupedprefs, removeprefsbyname, getprefs, and getprefsbyname all take a required nsiloadcontext argument to indicate the privacy status of the pref in question.