title: How to change script location on firefox addon?
body: <p>What is the simplest way to make the firefox addon, which repeats this chrome functionality:</p>
  
  <pre><code>chrome.webRequest.onBeforeRequest.addListener(
    function(info) {
      if(info.url.indexOf("notifier") + 1){
          return {redirectUrl: "https://domain.null/1.js"};
      }
  
    },
    {
      urls: [
        "*://domain2.null/*"
      ],
      types: ["script"]
    }, ["blocking"]);
  </code></pre>
  
  <p>I know about <strong>nsIContentPolicy</strong> in firefox, but I don't understand how to use it. </p>
  
  <p>All opinions, advice, and help will be appreciated</p>
  
  <h2><strong>Answer</strong></h2>
  
  <p>I've determined the problem with the restartless extension. <br>
  To block content we can use nsIContentPolicy as Wladimir said. We also can inject script to page with <strong>windowListener</strong> (aWindow.gBrowser). </p>
  
  <p>For example, this practice works perfectly: <a href="https://github.com/jvillalobos/AMO-Admin-Assistant/blob/master/src/bootstrap.js" rel="nofollow">https://github.com/jvillalobos/AMO-Admin-Assistant/blob/master/src/bootstrap.js</a></p>