[Pkg-mozext-commits] [requestpolicy] 64/280: bugfix: NormalRequest.prototype.getContentWindow

David Prévot taffit at moszumanska.debian.org
Sat May 2 20:30:00 UTC 2015


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

taffit pushed a commit to branch master
in repository requestpolicy.

commit 0e14086dee5432292ba3428e69aa15e209155593
Author: Martin Kimmerle <dev at 256k.de>
Date:   Thu Dec 25 15:36:16 2014 +0100

    bugfix: NormalRequest.prototype.getContentWindow
    
    The method
    NormalRequest.prototype.getContentWindow
    should always return a *content* window. This was not the case if
    aContext was a <browser> XUL Element. This is now fixed.
---
 src/content/lib/request.jsm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/content/lib/request.jsm b/src/content/lib/request.jsm
index 704dcaa..8cd35e6 100644
--- a/src/content/lib/request.jsm
+++ b/src/content/lib/request.jsm
@@ -199,12 +199,16 @@ NormalRequest.prototype.isInternal = function() {
 /**
  * Get the nsIDOMWindow related to this request.
  */
-NormalRequest.prototype.getWindow = function() {
+NormalRequest.prototype.getContentWindow = function() {
   let context = this.aContext;
   if (!context) {
     return null;
   }
 
+  if (context instanceof Ci.nsIDOMXULElement && context.tagName === "browser") {
+    return context.contentWindow;
+  }
+
   let win;
   try {
     win = context.QueryInterface(Ci.nsIDOMWindow);
@@ -299,7 +303,7 @@ NormalRequest.prototype.checkURISchemes = function() {
         "uncatched scheme '" + scheme + "'. The request is from <" +
         this.originURI + "> to <" + this.destURI + "> ");
     try {
-      let win = this.getWindow();
+      let win = this.getContentWindow();
       if (!win) {
         throw "The window could not be extracted from aContext.";
       }

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



More information about the Pkg-mozext-commits mailing list