Skip to content

Instantly share code, notes, and snippets.

@gkio
Created July 25, 2016 11:41
Show Gist options
  • Save gkio/7e46bc2344d9eb0eb5898c8375447d6c to your computer and use it in GitHub Desktop.
Save gkio/7e46bc2344d9eb0eb5898c8375447d6c to your computer and use it in GitHub Desktop.
var casper = require('casper').create();
casper.options.onResourceRequested = function(C, requestData, request) {
if ((/https?:\/\/.+?\.css/gi).test(requestData['url']) || requestData['Content-Type'] == 'text/css') {
console.log('Skipping CSS file: ' + requestData['url']);
request.abort();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment