Opening a simple window

Discuss building things with or for the Mozilla Platform.
Post Reply
krs0
Posts: 6
Joined: September 26th, 2012, 11:14 am

Opening a simple window

Post by krs0 »

Hey, I need some help in figuring out why a simple open.window does not work. I guessed that by putting it into the try code it is automatically called when browser starts.

Here my code:

script...

Code: Select all

/**
 * flyBarsEnhancedChrome namespace.
 */
if ("undefined" == typeof(flyBarsEnhancedChrome)) {
  var flyBarsEnhancedChrome = {};
};

/**
 * Controls the browser overlay for the Hello World extension.
 */
flyBarsEnhancedChrome.flyBarsEnhanced = {
  /**
   * Says 'Hello' to the user.
   */
  sayHello : function() {
    // let stringBundle = document.getElementById("flyBarsEnhanced-string-bundle");
    // let message = stringBundle.getString("flyBarsEnhanced.greeting.label");
   
   window.open("chrome://navigator/content/flyBarsEnhanced.xul", "chrome,width=600,height=300");
  }
};

try{

   flyBarsEnhanced.sayHello();
   
}catch(e){};


xul

Code: Select all

<?xml version="1.0"?>

<?xml-stylesheet type="text/css" href="chrome://global/skin/" ?>
<?xml-stylesheet type="text/css" href="chrome://flyBarsEnhanced/skin/flyBarsEnhanced.css" ?>

<!DOCTYPE overlay SYSTEM "chrome://flyBarsEnhanced/locale/flyBarsEnhanced.dtd">


   <window
      id="flyBarsEnhanced-window"
      title="&flyBarsEnhanced.title;"
      orient="horizontal"
      xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
   
      <!-- Other elements go here -->
   
      <button id="find-button" label="Find"/>
      <button id="cancel-button" label="Cancel"/>
      
   </window>
Post Reply