Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix unloading finally

  • Loading branch information...
commit 23160e3e40153cd434ac33fb2f65011c8c62d0fc 1 parent 7e6bd08
@gavinsharp authored
Showing with 1 addition and 13 deletions.
  1. BIN  SaveAsFilename.xpi
  2. +1 −13 bootstrap.js
View
BIN  SaveAsFilename.xpi
Binary file not shown
View
14 bootstrap.js
@@ -57,18 +57,11 @@ function startup(aData, aReason) {
}
function shutdown(aData, aReason) {
- function log(msg) {
- Components.utils.reportError("Gavin: " + msg);
- }
- log("Shutdown");
if (aReason != APP_SHUTDOWN) {
- log("Not app shutdown");
let enumerator = Services.wm.getEnumerator("navigator:browser");
while (enumerator.hasMoreElements()) {
let win = XPCNativeWrapper.unwrap(enumerator.getNext());
- log("Found window");
if (win._saveAsFilename_getDefaultFileName) {
- log("removing prop from window");
win.getDefaultFileName = win._saveAsFilename_getDefaultFileName;
delete win._saveAsFilename_getDefaultFileName;
}
@@ -76,11 +69,8 @@ function shutdown(aData, aReason) {
unloaders.forEach(function (f) {
try {
- log("unloading");
f();
- } catch (ex) {
- log("unloading failed: " + ex);
- }
+ } catch (ex) {}
});
}
}
@@ -89,7 +79,6 @@ function install(aData, aReason) { }
function uninstall(aData, aReason) { }
-
/* Code from: https://github.com/Mardak/restartless/blob/watchWindows/bootstrap.js */
let unloaders = [];
@@ -134,4 +123,3 @@ function watchWindows(callback) {
Services.ww.registerNotification(windowWatcher);
unloaders.push(function() Services.ww.unregisterNotification(windowWatcher));
}
-
Please sign in to comment.
Something went wrong with that request. Please try again.