title: Turn all textboxes into WYSIWYG HTML Editors using PageMod
body: <p>I am trying to create an addon that turns all textareas on certain pages into WYSIWYG HTML editors. I tried using <a href="https://addons.mozilla.org/en-US/developers/docs/sdk/1.5/packages/addon-kit/docs/page-mod.html" rel="nofollow">PageMod</a> by calling the NicEdit library and then running a content script with the code to turn all textareas into NicEdit editors. Here is the code I am trying to use:</p>
  
  <p>main.js:</p>
  
  <pre><code>// Import the APIs
  var pageMod = require("page-mod");
  var self = require("self");
  
  // Create a page mod
  // It will run a script whenever a URL is loaded
  pageMod.PageMod({
    include: "*",
    contentScriptFile: [self.data.url("nicEdit-latest.js"),
                        self.data.url("pagedit.js")]
  });
  </code></pre>
  
  <p>pagedit.js</p>
  
  <pre><code>bkLib.onDomLoaded(nicEditors.allTextAreas);
  </code></pre>
  
  <p>And then NicEdit-latest.js is just the NicEdit lirbrary.</p>
  
  <p>I saved and installed the addon and tried to load W3Schools' <a href="http://www.w3schools.com/tags/showit.asp?filename=tryhtml_textarea" rel="nofollow" title="W3Schools textarea demo">demo on textareas</a>, but the textarea still looked like a normal textarea.</p>