Bug 1223585 - [webext] Add some ignoreEvent calls (r=kmag)
authorBill McCloskey <billm@mozilla.com>
Tue, 10 Nov 2015 14:14:06 -0800
changeset 308650 be72540c9e57cdc7f272daed185069eb06c2101e
parent 308649 00e0498e420064f730086e369f459487f3ae02a5
child 308651 4371f650013131bdbd0efded140e64e8fb5aa9c4
push id7513
push useratolfsen@mozilla.com
push dateFri, 13 Nov 2015 14:03:43 +0000
reviewerskmag
bugs1223585
milestone45.0a1
Bug 1223585 - [webext] Add some ignoreEvent calls (r=kmag)
toolkit/components/extensions/ext-webRequest.js
--- a/toolkit/components/extensions/ext-webRequest.js
+++ b/toolkit/components/extensions/ext-webRequest.js
@@ -6,16 +6,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
                                   "resource://gre/modules/MatchPattern.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "WebRequest",
                                   "resource://gre/modules/WebRequest.jsm");
 
 Cu.import("resource://gre/modules/ExtensionUtils.jsm");
 var {
   SingletonEventManager,
   runSafeSync,
+  ignoreEvent,
 } = ExtensionUtils;
 
 // EventManager-like class specifically for WebRequest. Inherits from
 // SingletonEventManager. Takes care of converting |details| parameter
 // when invoking listeners.
 function WebRequestEventManager(context, eventName)
 {
   let name = `webRequest.${eventName}`;
@@ -121,11 +122,15 @@ extensions.registerPrivilegedAPI("webReq
       onBeforeSendHeaders: new WebRequestEventManager(context, "onBeforeSendHeaders").api(),
       onSendHeaders: new WebRequestEventManager(context, "onSendHeaders").api(),
       onHeadersReceived: new WebRequestEventManager(context, "onHeadersReceived").api(),
       onResponseStarted: new WebRequestEventManager(context, "onResponseStarted").api(),
       onCompleted: new WebRequestEventManager(context, "onCompleted").api(),
       handlerBehaviorChanged: function() {
         // TODO: Flush all caches.
       },
+
+      // TODO
+      onBeforeRedirect: ignoreEvent(context, "webRequest.onBeforeRedirect"),
+      onErrorOccurred: ignoreEvent(context, "webRequest.onErrorOccurred"),
     },
   };
 });