Bug 1462121 - Ignore untrusted pagehide/pageshow events draft
authorRob Wu <rob@robwu.nl>
Thu, 17 May 2018 15:12:57 +0200
changeset 796415 7ca348cacee283c7c001fb2927b3ff4501fcf02b
parent 796414 8660bdb2ac50776a58c88f3ace04628cd773bcd5
child 796416 c88caa1a5b72ea7331e16efd52f392191f5bdf4a
push id110248
push userbmo:rob@robwu.nl
push dateThu, 17 May 2018 17:12:40 +0000
bugs1462121
milestone62.0a1
Bug 1462121 - Ignore untrusted pagehide/pageshow events MozReview-Commit-ID: AiSUarMT1GF
toolkit/components/extensions/ExtensionCommon.jsm
--- a/toolkit/components/extensions/ExtensionCommon.jsm
+++ b/toolkit/components/extensions/ExtensionCommon.jsm
@@ -173,18 +173,18 @@ class BaseContext {
           this.contentWindow = null;
           this.active = false;
         }
       },
     };
 
     this.contentWindow = contentWindow;
     this.active = true;
-    contentWindow.addEventListener("pagehide", handler, {mozSystemGroup: true});
-    contentWindow.addEventListener("pageshow", handler, {mozSystemGroup: true});
+    contentWindow.addEventListener("pagehide", handler, {mozSystemGroup: true}, false);
+    contentWindow.addEventListener("pageshow", handler, {mozSystemGroup: true}, false);
     this.callOnClose({
       close: () => {
         if (isValidInnerWindow()) {
           contentWindow.removeEventListener("pagehide", handler, {mozSystemGroup: true});
           contentWindow.removeEventListener("pageshow", handler, {mozSystemGroup: true});
         }
         // Replace handler to release the original handleEvent closure.
         handler.handleEvent = function(event) {