Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Do not attempt to assign to a property of Components.utils.

Like 912cd95 for the 0.9 branch, but cleaner syntax given a night to sleep on it.

Refs #1578
Refs #1594
  • Loading branch information...
commit d8c616572f527bfd44eeb756ea373b101abceb82 1 parent 2a09200
@arantius authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 components/greasemonkey.js
View
10 components/greasemonkey.js
@@ -14,10 +14,6 @@ Cu.import("resource://greasemonkey/prefmanager.js");
Cu.import("resource://greasemonkey/util.js");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-if (!Cu.isDeadWrapper) {
- Cu.isDeadWrapper = function() { return false; };
-}
-
var gScriptDirPath = (function() {
var ios = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
@@ -431,7 +427,11 @@ service.prototype.__defineGetter__('config', function() {
service.prototype.contentDestroyed = function(contentWindowId) {
this.withAllMenuCommandsForWindowId(null, function(index, command) {
- var closed = Cu.isDeadWrapper(command.contentWindow);
+ // Only Firefox 15+ defines isDeadWrapper; use it to detect dead windows
+ // (for which we will never be able to access the .closed property).
+ var closed = Cu.isDeadWrapper
+ ? Cu.isDeadWrapper(command.contentWindow)
+ : false;
try { closed = command.contentWindow.closed; } catch (e) { }
if (closed ||
Please sign in to comment.
Something went wrong with that request. Please try again.