title: How can I control PhantomJS to skip download some kind of resource?
body: <p>phantomjs has config loadImage,</p>
  
  <p>but I want more, </p>
  
  <p>how can I control phantomjs to skip download some kind of resource, </p>
  
  <p>such as css etc...</p>
  
  <p>=====</p>
  
  <p>good news:
  this feature is added.</p>
  
  <p><a href="https://code.google.com/p/phantomjs/issues/detail?id=230">https://code.google.com/p/phantomjs/issues/detail?id=230</a></p>
  
  <p>The gist:</p>
  
  <pre><code>page.onResourceRequested = function(requestData, request) {
      if ((/http:\/\/.+?\.css/gi).test(requestData['url']) || requestData['Content-Type'] == 'text/css') {
          console.log('The url of the request is matching. Aborting: ' + requestData['url']);
          request.abort();
      }
  };
  </code></pre>