title: Modifying remote JavaScripts as they load with CefSharp?
body: <p>I am building a custom browser as part of an interface to a remote website.  Their GUI sucks so I'm doing some JavaScript hacks to make it look better.</p>
  
  <p>Currently, to make modifications to their UI I am using the following GreaseMonkey script (on Firefox):</p>
  
  <pre><code>// ==UserScript==
  // @name        winman-load
  // @namespace   winman
  // @description stuff to do when winman.js loads
  // @include     https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/
  // @version     1
  // @grant       none
  // @run-at document-start
  // ==/UserScript==
  
  document.addEventListener("beforescriptexecute", function(e) {
      src = e.target.src;
      content = e.target.text;
  
      //console.log("src: " + src);
  
      if (src.search("winman.js") &gt; -1) {
  
         console.info("============ new winman ===========\n" + src);
  
          var newContent = "";
  
          $.ajax({
           async: false,
           type: 'GET',
           url: '/script/winman.js',
           success: function(data) {
             newContent = data.replace('pos += currentPos;', 'pos += currentPos + 100;');
             newContent = newContent.replace('var enable = false;', 'var enable = true;');
             newContent = newContent.replace('var available = true;', 'var available = false;');
           }
          });
  
  
          // Stop original script
          e.preventDefault();
          e.stopPropagation();
          unsafeWindow.jQuery(e.target).remove();
  
          var script = document.createElement('script');
  
          script.textContent = newContent;
  
          (document.head || document.documentElement).appendChild(script);
          script.onload = function() {
              this.parentNode.removeChild(this);
          }
  
  
      }
  
  });
  </code></pre>
  
  <p>I want to be able to do something if this nature with CefSharp, where I can modify the scripts on-the-fly as the browser loads the page.</p>