[Pkg-mozext-commits] [requestpolicy] 120/257: [fix] R21n: show on blocked header redirection

David Prévot taffit at moszumanska.debian.org
Thu Jan 28 03:20:04 UTC 2016


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

taffit pushed a commit to branch master
in repository requestpolicy.

commit 41366d3095c686a843d9bcaa912f9731551fd47a
Author: Martin Kimmerle <dev at 256k.de>
Date:   Thu Oct 29 17:12:14 2015 +0100

    [fix] R21n: show on blocked header redirection
    
    Fixes #722.
---
 src/content/ui/overlay.js                             | 19 ++++++++++++++++++-
 .../tests/redirections/test_auto_redirect.py          | 11 +++--------
 2 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/src/content/ui/overlay.js b/src/content/ui/overlay.js
index e15b83c..f2cc57b 100644
--- a/src/content/ui/overlay.js
+++ b/src/content/ui/overlay.js
@@ -564,8 +564,25 @@ rpcontinued.overlay = (function() {
         //       https://en.wikipedia.org/wiki/URL_redirection
       ];
       const priority = notificationBox.PRIORITY_WARNING_MEDIUM;
-      notificationBox.appendNotification(notificationLabel, notificationValue,
+      
+      let notificationElem = notificationBox.appendNotification(
+          notificationLabel, notificationValue,
           "chrome://browser/skin/Info.png", priority, buttons);
+      
+      // Let the notification persist at least 300ms. This is needed in the
+      // following scenario:
+      //     If an URL is entered on an empty tab (e.g. "about:blank"),
+      //     and that URL redirects to another URL with a different
+      //     host, and that redirect is blocked by RequestPolicy,
+      //     then immediately after blocking the redirect Firefox will make
+      //     a location change, maybe back from the blocked URL to
+      //     "about:blank". In any case, when the location changes, the
+      //     function `notificationbox.removeTransientNotifications()`
+      //     is called. It checks for the `persistence` and `timeout`
+      //     properties. See MDN documentation:
+      //     https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/notification
+      // See also issue #722.
+      notificationElem.timeout = Date.now() + 300;
     }
     return true;
   };
diff --git a/tests/marionette/tests/redirections/test_auto_redirect.py b/tests/marionette/tests/redirections/test_auto_redirect.py
index 7e44d9e..272f947 100644
--- a/tests/marionette/tests/redirections/test_auto_redirect.py
+++ b/tests/marionette/tests/redirections/test_auto_redirect.py
@@ -69,17 +69,12 @@ class TestAutoRedirect(RequestPolicyTestCase):
 
             self.redir.close()
 
+        # FIXME: Issue #727;   On E10s, Marionette Tests for HTTP
+        #        <location|refresh> header redirections raise IOError.
         if not self.browser_info.e10s_enabled:
-            # FIXME: Issue #722;  There should be a notification bar for
-            #        HTTP <location|refresh> header redirections.
-            # FIXME: If these two tests were activated on E10s, they would
-            #        be paused for several minutes until they fail as follows:
-            #            IOError: process died with returncode None
-            #        This might be related to Mozilla Bug 1209373:
-            #            `marionette.navigate()` throws `IOError` instead
-            #            of `TimeoutException`.
             test_appear("redirect-http-location-header.php")
             test_appear("redirect-http-refresh-header.php")
+
         test_appear("redirect-js-document-location-auto.html")
         test_appear("redirect-meta-tag-01-immediate.html")
         test_appear("redirect-meta-tag-02-delayed.html")

-- 
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