[Pkg-mozext-commits] [greasemonkey] 08/20: TypeError: can't access dead object

David Prévot taffit at moszumanska.debian.org
Fri Mar 25 21:37:20 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository greasemonkey.

commit afb6d36398cd8885f6983ba0e48bdaeff4b76352
Author: janekptacijarabaci <janekptacijarabaci at seznam.cz>
Date:   Tue Mar 1 13:37:45 2016 +0100

    TypeError: can't access dead object
---
 content/framescript.js | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/content/framescript.js b/content/framescript.js
index 3d459e6..9d1ab8a 100644
--- a/content/framescript.js
+++ b/content/framescript.js
@@ -108,6 +108,7 @@ function injectScripts(aScripts, aContentWin) {
   }
 
   var url = urlForWin(aContentWin);
+  if (!url) return;
   var winIsTop = windowIsTop(aContentWin);
 
   for (var i = 0, script = null; script = aScripts[i]; i++) {
@@ -138,6 +139,7 @@ function newScriptLoadStart(aMessage) {
 
 function runScripts(aRunWhen, aContentWin) {
   var url = urlForWin(aContentWin);
+  if (!url) return;
   if (!GM_util.isGreasemonkeyable(url)) return;
 
   var scripts = IPCScript.scriptsForUrl(
@@ -153,6 +155,9 @@ function urlForWin(aContentWin) {
   // But the content can call replacestate() much later, too.  The only way to
   // be consistent is to ignore it.  Luckily, the  document.documentURI does
   // _not_ change, so always use it when deciding whether to run scripts.
+  if (GM_util.windowIsClosed(aContentWin)) {
+    return false;
+  }
   var url = aContentWin.document.documentURI;
   // But ( #1631 ) ignore user/pass in the URL.
   return url.replace(gStripUserPassRegexp, '$1');

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git



More information about the Pkg-mozext-commits mailing list