<commit_before>var { Cc, Ci, Cr } = require('chrome');

exports.setup = function(panel) {
  var observer = {
    observe: function (subject, topic, data) {
      if ('http-on-modify-request' !== topic) {
        return;
      }

      subject.QueryInterface(Ci.nsIHttpChannel);
      var url = subject.URI.spec

      if (!/https:\/\/www.uproxy.org\/(request|offer)\/(.*)/.test(url)) {
        return;
      }

      panel.port.emit('handleUrlData', url);
      panel.port.emit('showPanel');

      subject.cancel(Cr.NS_BINDING_ABORTED);
    }
  };

  var service = Cc['@mozilla.org/observer-service;1'].getService(Ci.nsIObserverService);
  service.addObserver(observer, 'http-on-modify-request', false);
};
<commit_msg>Fix a small mistake in how opening the uProxy panel is done in Firefox<commit_after>var { Cc, Ci, Cr } = require('chrome');

exports.setup = function(panel) {
  var observer = {
    observe: function (subject, topic, data) {
      if ('http-on-modify-request' !== topic) {
        return;
      }

      subject.QueryInterface(Ci.nsIHttpChannel);
      var url = subject.URI.spec

      if (!/https:\/\/www.uproxy.org\/(request|offer)\/(.*)/.test(url)) {
        return;
      }

      panel.port.emit('handleUrlData', url);
      panel.show();

      subject.cancel(Cr.NS_BINDING_ABORTED);
    }
  };

  var service = Cc['@mozilla.org/observer-service;1'].getService(Ci.nsIObserverService);
  service.addObserver(observer, 'http-on-modify-request', false);
};

{'fraction_non_alphanumeric': 0.16948008102633355, 'fraction_numerical': 0.0013504388926401081, 'mean_word_length': 2.9310344827586206, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6515572', 'n_tokens_mistral': 513, 'n_tokens_neox': 491, 'n_words': 83}