marcelduran / yslow

YSlow analyzes web pages and suggests ways to improve their performance based on a set of rules for high performance web pages.
yslow.org
BSD 3-Clause "New" or "Revised" License
2.21k stars 384 forks source link

when use phantomjs2.0 to test some website ,i got 'args.length' issue. #172

Closed qileilove closed 8 years ago

qileilove commented 8 years ago
phantomjs yslow.js --help
TypeError: undefined is not an object (evaluating 'args.length')
 yslow.js:5 in global code
qileilove commented 8 years ago

ok, i have fixed this issue,use https://github.com/sitespeedio/yslow/blob/master/src/phantomjs/controller.js instead of your local controller.js file,then compile again,it works now. but the http://yslow.org/phantomjs/ website offer the download yslow.js haven't fixed this issue. anybody if you encounter problems like me please noticed.

sowmiyar commented 7 years ago

i have used the same yslow.js which you mentioned.. but when i execute phantomjs yslow.js -- help..

i m getting

Usage: phantomjs [phantomjs options] undefined [yslow options] [url ...]

PhantomJS Options:

http://y.ahoo.it/phantomjs/options

YSlow Options:

-h, --help               output usage information
-V, --version            output the version number
-i, --info <info>        specify the information to display/log (basic|grade|stats|comps|all) [all]
-f, --format <format>    specify the output results format (json|xml|plain|tap|junit) [json]
-r, --ruleset <ruleset>  specify the YSlow performance ruleset to be used (ydefault|yslow1|yblog) [ydefault]
-b, --beacon <url>       specify an URL to log the results
-d, --dict               include dictionary of results fields
-v, --verbose            output beacon response information
-t, --threshold <score>  for test formats, the threshold to test scores ([0-100]|[A-F]|{JSON}) [80]
                         e.g.: -t B or -t 75 or -t '{"overall": "B", "ycdn": "F", "yexpires": 85}'
-u, --ua "<user agent>"  specify the user agent string sent to server when the page requests resources
-vp, --viewport <WxH>    specify page viewport size WxY, where W = width and H = height [400x300]
-ch, --headers <JSON>    specify custom request headers, e.g.: -ch '{"Cookie": "foo=bar"}'
-c, --console <level>    output page console messages (0: none, 1: message, 2: message + line + source) [0]
--cdns "<list>"          specify comma separated list of additional CDNs
-ba, --basicauth "<username:password>"          username & password used for basic auth
--file <filename>        output the result to file
--waitScript "return true;"          a javascript that will be evaluated to decide when fetching a page is finished

Examples:

phantomjs undefined http://yslow.org
phantomjs undefined -i grade -f xml www.yahoo.com www.cnn.com www.nytimes.com
phantomjs undefined --info all --format plain --ua "MSIE 9.0" http://yslow.org
phantomjs undefined -i basic --rulseset yslow1 -d http://yslow.org
phantomjs undefined -i grade -b http://www.showslow.com/beacon/yslow/ -v yslow.org
phantomjs --load-plugins=yes undefined -vp 800x600 http://www.yahoo.com
phantomjs undefined -i grade -f tap -t 85 http://yslow.org

everywhere im getting "undefined " in place of yslow.js ..

when i execute the phantomjs yslow.is anyurl..

im getting "fail to load undefined".. Please help.

andyzhou192 commented 6 years ago

hello,the file you have given (https://github.com/sitespeedio/yslow/blob/master/src/phantomjs/controller.js) is not exist,coulde you give the detail ? @qileilove

daluu commented 6 years ago

See related issue #175? Which has a different solution.

And does the OP have a copy of the now gone good controller.js file?