In general, do not do this.
However, if you really need it, you can enable JavaScript, but block the download of external .js files. For instance:.
page.onResourceRequested = function(requestData, request) {
if (requestData['Content-Type'] == 'application/javascript' || requestData['Content-Type'] == 'text/javascript') {
console.log('Disabling JavaScript files. Aborting: ' + requestData['url']);
request.abort();
}
};
source
share