27 Components.utils.import(
"resource://gre/modules/XPCOMUtils.jsm");
29 const Ci = Components.interfaces;
30 const Cc = Components.classes;
33 window.addEventListener(
"unload",
34 function songbird_extensionManager_unload() {
35 gExtensionsView.builder.removeListener(TemplateBuilderListener);
38 function fixResizers() {
41 var resizersList = document.getElementsByTagName(
"resizer");
42 var resizerCount = resizersList.length;
43 for (var index = 0; index < resizerCount; index++) {
44 var resizer = resizersList.item(index);
46 resizer.dir = resizer.dir;
53 var TemplateBuilderListener = {
54 willRebuild:
function(){},
55 didRebuild:
function SBEMDidRebuild(aBuilder) {
56 const RDF_INSTALL_MANIFEST =
57 gRDF.GetResource(
"urn:mozilla:install-manifest");
59 gRDF.GetResource(
"http://www.mozilla.org/2004/em-rdf#hidden");
60 const RDF_TRUE =
gRDF.GetLiteral(
"true");
61 var
ios =
Cc[
"@mozilla.org/network/io-service;1"]
62 .getService(
Ci.nsIIOService);
66 Array.forEach(gExtensionsView.children,
function(itemElem) {
67 if (!(itemElem.hasAttribute(
"addonID")) ||
68 itemElem.hasAttribute(
"songbird_checked"))
75 itemElem.setAttribute(
"songbird_checked",
true);
79 var addonID = itemElem.getAttribute(
"addonID");
80 var installLocation = gExtensionManager.getInstallLocation(addonID);
81 if (!installLocation.restricted) {
83 itemElem.setAttribute(
"restricted",
false);
89 var RDFLoadObserver = {
90 onBeginLoad:
function(){},
91 onInterrupt:
function(){},
92 onResume:
function(){},
93 onError:
function(){},
94 onEndLoad:
function(aSink) {
95 aSink.removeXMLSinkObserver(
this);
96 if (rdfDS.HasAssertion(RDF_INSTALL_MANIFEST,
103 itemElem.setAttribute(
"hidden",
true);
111 var installRDF = installLocation.getItemFile(addonID,
"install.rdf");
112 var rdfDS =
gRDF.GetDataSource(ios.newFileURI(installRDF).spec)
114 .QueryInterface(
Ci.nsIRDFXMLSink);
115 rdfDS.addXMLSinkObserver(RDFLoadObserver);
119 RDFLoadObserver.onEndLoad(rdfDS);
130 gExtensionsView.builder.addListener(TemplateBuilderListener);
132 TemplateBuilderListener.didRebuild(gExtensionsView.builder);
136 var
wm = Components.classes[
"@mozilla.org/appshell/window-mediator;1"]
137 .getService(Components.interfaces.nsIWindowMediator);
138 var mainWin = wm.getMostRecentWindow(
"Songbird:Main");
139 if (mainWin && mainWin.window && mainWin.window.gBrowser) {
149 var externalLoader = (Components
150 .classes[
"@mozilla.org/uriloader/external-protocol-service;1"]
151 .getService(Components.interfaces.nsIExternalProtocolService));
152 var nsURI = (Components
153 .classes[
"@mozilla.org/network/io-service;1"]
154 .getService(Components.interfaces.nsIIOService)
156 externalLoader.loadURI(nsURI,
null);
function songbird_extensionManager_overlay()
sbOSDControlService prototype QueryInterface
function openURLExternal(url)