mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-05 18:35:47 +01:00
Fix about:pentadactyl = about:undefined in Gecko<2.0.
This commit is contained in:
@@ -4,29 +4,34 @@
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
"use strict";
|
||||
|
||||
const Ci = Components.interfaces, Cc = Components.classes;
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
const prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService)
|
||||
.getBranch("extensions.dactyl.");
|
||||
const appName = prefs.getComplexValue("appName", Ci.nsISupportsString).data;
|
||||
const name = prefs.getComplexValue("name", Ci.nsISupportsString).data;
|
||||
|
||||
function CommandLineHandler() {
|
||||
this.wrappedJSObject = this;
|
||||
}
|
||||
CommandLineHandler.prototype = {
|
||||
|
||||
classDescription: "Dactyl Command-line Handler",
|
||||
classDescription: appName + " Command-line Handler",
|
||||
|
||||
classID: Components.ID("{16dc34f7-6d22-4aa4-a67f-2921fb5dcb69}"),
|
||||
|
||||
contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=dactyl",
|
||||
contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=" + name,
|
||||
|
||||
_xpcom_categories: [{
|
||||
category: "command-line-handler",
|
||||
entry: "m-dactyl"
|
||||
entry: "m-" + name
|
||||
}],
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsICommandLineHandler]),
|
||||
|
||||
handle: function (commandLine) {
|
||||
let name = Components.classes["@dactyl.googlecode.com/base/dactyl"]
|
||||
.getService().wrappedJSObject.name;
|
||||
// TODO: handle remote launches differently?
|
||||
try {
|
||||
this.optionValue = commandLine.handleFlagWithParam(name, false);
|
||||
|
||||
Reference in New Issue
Block a user