application.js: fix matching of module load error messages to work with Firefox 36
[conkeror.git] / modules / http-request-hook.js
blob4c52caf9e4c0f01a534ca8f870a61b586f8ecac0
1 /**
2  * (C) Copyright 2013 John J. Foerch
3  *
4  * Use, modification, and distribution are subject to the terms specified in the
5  * COPYING file.
6 **/
8 define_hook("http_request_hook");
10 var http_request_observer = {
11     observe: function (subject, topic, data) {
12         if (topic != "http-on-modify-request")
13             return;
14         subject.QueryInterface(Ci.nsIHttpChannel);
15         http_request_hook.run(subject);
16     }
19 function http_request_hook_enable () {
20     observer_service.addObserver(http_request_observer,
21                                  "http-on-modify-request",
22                                  false);
25 function http_request_hook_disable () {
26     observer_service.removeObserver(http_request_observer,
27                                     "http-on-modify-request");
30 http_request_hook_enable();
32 provide("http-request-hook");