Fix typo in `loadurlwithoutcss` example

Issue: https://github.com/ariya/phantomjs/issues/11321
1.x
Vitaliy Slobodin 2013-06-23 11:28:51 +04:00
parent 4d916971b3
commit fdec25ac4c
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ if system.args.length < 2
address = system.args[1]
page.onResourceRequested = (requestData, request) ->
if (/http:\/\/.+?\.css/g).test(requestData["url"]) or requestData["Content-Type"] is "text/css"
if (/http:\/\/.+?\.css/g).test(requestData["url"]) or requestData.headers["Content-Type"] is "text/css"
console.log "The url of the request is matching. Aborting: " + requestData["url"]
request.abort()

View File

@ -9,7 +9,7 @@ if (system.args.length < 2) {
var address = system.args[1];
page.onResourceRequested = function(requestData, request) {
if ((/http:\/\/.+?\.css/gi).test(requestData['url']) || requestData['Content-Type'] == 'text/css') {
if ((/http:\/\/.+?\.css/gi).test(requestData['url']) || requestData.headers['Content-Type'] == 'text/css') {
console.log('The url of the request is matching. Aborting: ' + requestData['url']);
request.abort();
}