Skip to content
This repository has been archived by the owner on Oct 11, 2020. It is now read-only.

Commit

Permalink
Keep the button hidden after updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
hultmann committed Sep 18, 2013
1 parent d46b0bb commit e399fed
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
18 changes: 15 additions & 3 deletions src/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ Cu.import("resource://gre/modules/Services.jsm");


// install & uninstall are called even for disabled extensions
var _install = false;
function install(data, reason) {
_install = true;
}


Expand All @@ -38,9 +36,23 @@ function startup(data, reason) {
registerResourceProtocol(data.resourceURI);
registerAbout();

var firstRun = false;
var reinstall = false;
if (reason !== APP_STARTUP) {
switch (reason) {
case ADDON_INSTALL:
firstRun = true;
break;
case ADDON_UPGRADE:
case ADDON_DOWNGRADE:
reinstall = true;
break;
}
}

var ns = {};
Cu.import("${PATH_MODULE}/new-window.js", ns);
ns.Bootstrap.extensionStartup(_install);
ns.Bootstrap.extensionStartup(firstRun, reinstall);
}


Expand Down
8 changes: 4 additions & 4 deletions src/modules/new-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ var m_docObserver = null;

var Bootstrap = {

extensionStartup: function(installing) {
extensionStartup: function(firstRun, reinstall) {
console.assert(m_docObserver === null, "m_docObserver should be null");
console.assert(m_pendingNewWindows.length === 0, "m_pendingNewWindows should be empty");

if (installing) {
this._firstRun = true;
if (firstRun || reinstall) {
this._firstRun = firstRun;
var desc = util.getTextFrom("extensions.${EXT_ID}.description", "about-multifox");
util.setUnicodePref("description", desc);
}
Expand Down Expand Up @@ -75,7 +75,7 @@ var Bootstrap = {
},

extensionShutdown: function() {
Services.obs.removeObserver("${BASE_DOM_ID}-id-changed", UpdateUI);
Services.obs.removeObserver(UpdateUI, "${BASE_DOM_ID}-id-changed");
m_docObserver.shutdown();
ExtCompat.uninstallAddonListener();
var enumWin = Services.wm.getEnumerator(null);
Expand Down

0 comments on commit e399fed

Please sign in to comment.