Assuming that you want to suppress the loading of all external stylesheets, you can do this by interrupting requests for loading css files, which is done by assigning the options.onResourceRequested function:
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(); } }
To avoid using inline style sheets, my only idea is to use some JavaScript to remove all styles immediately after the page loads.
If you used SlimerJS with CasperJS, then Gecko almost certainly has an option to disable CSS (based on the fact that the web developer plugin has an option).
Darren cook
source share