Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: gavinsharp/SaveAsFilename
base: 45762216b0
...
head fork: gavinsharp/SaveAsFilename
compare: 7e6bd08bda
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 16 additions and 4 deletions.
  1. BIN  SaveAsFilename.xpi
  2. +16 −4 bootstrap.js
View
BIN  SaveAsFilename.xpi
Binary file not shown
View
20 bootstrap.js
@@ -57,18 +57,30 @@ function startup(aData, aReason) {
}
function shutdown(aData, aReason) {
+ function log(msg) {
+ Components.utils.reportError("Gavin: " + msg);
+ }
+ log("Shutdown");
if (aReason != APP_SHUTDOWN) {
- let enumerator = wm.getEnumerator("navigator:browser");
+ log("Not app shutdown");
+ let enumerator = Services.wm.getEnumerator("navigator:browser");
while (enumerator.hasMoreElements()) {
- let win = enumerator.getNext();
- if (win._saveAsFilename_getDefaultFileName)
+ 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;
+ }
}
unloaders.forEach(function (f) {
try {
+ log("unloading");
f();
- } catch (ex) {}
+ } catch (ex) {
+ log("unloading failed: " + ex);
+ }
});
}
}

No commit comments for this range

Something went wrong with that request. Please try again.