More Related Content Similar to JavaScript shell scripting Similar to JavaScript shell scripting (20) More from Stoyan Stefanov More from Stoyan Stefanov (20) JavaScript shell scripting18. var a = "Hello",!
b = " WSH!",!
c = a + b;!
!
WScript.Echo(c);!
21. var ie = new ActiveXObject!
("InternetExplorer.Application");!
ie.Visible = true;!
ie.navigate('yahoo.com');!
31. e.g.!
max 2 scripts!
max 2 styles!
max 9 images!
max 0 redirects!
33. var http = new ActiveXObject!
("HTTPWatch.Controller"),!
ie = http.IE.New(),!
ff = http.Firefox.New();!
37. var http = new HTTPWatch('ff');!
http.go('search.yahoo.com');!
http.done();!
39. var har = http.toHAR();!
har = eval('(' + har + ')');!
!
print(har.log.browser.name);!
print(har.log.browser.version);!
print('# requests: ');!
print(har.log.entries.length);!
42. var comps =!
http.getComponentsByType();!
!
for (var i in comps) {!
print(i);!
print(comps[i].length);!
}!
47. var http = new HTTPWatch();!
http.go('search.yahoo.com');!
!
var d = http.watch.container.document;!
!
print(d!
! .getElementsByTagName('*')!
! .length);!
!
print(d!
! .documentElement!
! .innerHTML);!
48. require('statz.js');!
!
var doc = http.watch!
! ! .container.document;!
var html = http.har.log!
! ! .entries[0]!
! ! .response.content.text;!
!
var out = statz(document, html);!
print(out.join("n"));!
49. JS attributes (e.g. onclick): 1207 bytes!
CSS style attributes: 883!
Inline JS: 5243!
Inline CSS: 5015!
All innerHTML: 17283!
# DOM elements: 134!
!
Total size: 14124 bytes!
Content size: 401 bytes!
Content-to-markup ratio: 0.03!