https://github.com/mozilla/gecko-dev
Raw File
Tip revision: 2a0900258d4eeb291128fd3b338a670bbdbd3b76 authored by ffxbld on 04 July 2012, 15:50:08 UTC
Added FENNEC_14_0_RELEASE FENNEC_14_0_BUILD2 tag(s) for changeset 35a98282d2a6. DONTBUILD CLOSED TREE a=release
Tip revision: 2a09002
CommandLineHandler.js
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;

Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");

// Initialize DOMApplicationRegistry so it can receive and respond to messages
Cu.import("resource://gre/modules/Webapps.jsm");

function CommandLineHandler() {}

CommandLineHandler.prototype = {
  classID: Components.ID("{6d69c782-40a3-469b-8bfd-3ee366105a4a}"),

  QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]),

  handle: function handle(cmdLine) {
    Services.ww.openWindow(null,
                           "chrome://webapprt/content/webapp.xul",
                           "_blank",
                           "chrome,dialog=no,all,resizable",
                           null);
  },

  helpInfo : "",
};

let components = [CommandLineHandler];
let NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
back to top