text: /* -*- mode: javascript; tab-width: 8; indent-tabs-mode: nil; js-indent-level: 2 -*- */
  /* 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/. */
  
  
  browser.runtime.onInstalled.addListener(async (aInstall) => {
    if (aInstall.reason == "install") {
      log("remoteStorage Demo: Extension installed.");
  
      await setDefaultPrefs();
      init();
    }
  });
  
  browser.runtime.onStartup.addListener(() => {
    log("remoteStorage Demo: Initializing extension during browser startup.");
    init();
  });
  
  
  async function setDefaultPrefs()
  {
    let defaultPrefs = aePrefs.getDefaultPrefs();
    await aePrefs.setPrefs(defaultPrefs);
  }
  
  
  function init()
  {
    // TO DO: Perform initialization.
  }
  
  
  function log(aMessage)
  {
    if (aeConst.DEBUG) { console.log(aMessage) }
  }
  