VulpesOS/gaia/tools/extensions/gaia-build@gaiamobile.org/bootstrap.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

68 lines
1.7 KiB
JavaScript
Executable file

'use strict';
const CC = Components.Constructor;
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cm = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
Cu.import('resource://gre/modules/Services.jsm');
// Register about:gaia page
let classID = Components.ID('{58d667ee-f9e8-4545-841c-927d86906620}');
function AboutGaia() {}
AboutGaia.prototype = {
classID: classID,
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),
getURIFlags: function(aURI) {
return Ci.nsIAboutModule.ALLOW_SCRIPT;
},
newChannel: function(aURI, aLoadInfo) {
let spec = 'chrome://gaia-build/content/aboutGaia.html';
let uri = Services.io.newURI(spec, null, null);
let channel = Services.io.newChannelFromURIWithLoadInfo(uri, aLoadInfo);
channel.originalURI = aURI;
return channel;
}
};
function registerAbout() {
let contract = '@mozilla.org/network/protocol/about;1?what=gaia';
let instance = null;
let newFactory = {
createInstance: function(outer, iid) {
if (outer)
throw Components.results.NS_ERROR_NO_AGGREGATION;
if (instance === null)
instance = new AboutGaia();
return instance;
},
lockFactory: function(aLock) {
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
},
QueryInterface: XPCOMUtils.generateQI([Ci.nsIFactory])
};
Cm.registerFactory(classID, '', contract, newFactory);
}
function startup(data, reason) {
try {
registerAbout();
} catch (e) {
Cu.reportError(e + '\n' + e.stack);
}
}
function shutdown(data, reason) {
}
function install(data, reason) {
}
function uninstall(data, reason) {
}