This repository has been archived by the owner on May 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
/
release-1.7.html
executable file
·191 lines (156 loc) · 9.38 KB
/
release-1.7.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title>PhantomJS 1.7 Release Notes</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="screen.min.css">
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-21665893-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<link rel="stylesheet" type="text/css" href="prettify.css"/>
<link rel="stylesheet" type="text/css" href="snippet.css"/>
<script type="text/javascript" src="js/prettify.js"></script>
<style>
#description p {
line-height: 125%;
text-align: left;
margin-bottom: 10px;
margin-top: 10px;
}
#description h2 {
text-align: left;
margin: 0.8em 0;
font-size: 150%;
}
#description ul {
line-height: 125%;
list-style-type: disc;
margin-left: 1em;
margin-bottom: 1em;
}
#description li {
margin-left: 1em;
}
</style>
</head>
<body onload="prettyPrint()">
<div id="intro">
<div id="header" class="container_12">
<a href="index.html" class="grid_4 alpha"><img src="images/phantomjs-logo.png" alt="PhantomJS" id="logo" width="240" height="80"></a>
<ul id="nav" class="grid_8 omega">
<li><a href="https://github.com/ariya/phantomjs">Source Code</a></li>
<li><a href="https://github.com/ariya/phantomjs/wiki">Documentation</a></li>
<li><a href="https://github.com/ariya/phantomjs/wiki/API-Reference">API</a></li>
<li><a href="https://github.com/ariya/phantomjs/wiki/Examples">Examples</a></li>
<li><a href="faq.html">FAQ</a></li>
</ul>
</div>
<div id="introduction" class="container_12">
<div class="grid_7 alpha">
<h1>PhantomJS 1.7 Release Notes</h1>
</div>
</div>
</div>
<div id="description" class="container_12">
<div class="grid_10">
<p>PhantomJS 1.7, <em><a href="release-names.html">Blazing Star</a></em>, was released on September 22, 2012. It added module system support (modelled after CommonJS), better cookies handling, additional input events, and other small improvements.</p>
<p><strong>Module system</strong></p>
<p>There has been module system support for a while, however it works only for internal modules. In this release, that support is extended for generic module written in JavaScript or CoffeeScript. The construct for the module system is modelled after <a href="http://wiki.commonjs.org/wiki/Modules/1.1.1">CommonJS Modules 1.1</a>.</p>
<p>As an example, supposed there is a script <code>universe.js</code> which contains the following code:</p>
<pre class="prettyprint lang-js">
exports.answer = 42;
exports.start = function () {
console.log('Starting the universe....');
}
</pre>
<p>This module can be used in another script like the following:</p>
<pre class="prettyprint lang-js">
var universe = require('./universe');
universe.start();
console.log('The answer is', universe.answer);
</pre>
<p>With this module support, a long PhantomJS script can be broken down into smaller files and thus it becomes more maintainable.</p>
<p><strong>Cookies handling</strong></p>
<p>Support for cookies has been added in the previous version. In this release, the implementation is significantly improved in order to make it behave as similar as possible in a real web browser. The cookies are stored in a global container ("cookiejar") which can be serialized and modified easily.</p>
<p>The following simple example shows every single cookie set when accessing a web site:</p>
<pre class="prettyprint lang-js">
var page = require('webpage').create();
phantom.cookiesEnabled = true;
page.open('http://m.bing.com', function () {
console.log(JSON.stringify(phantom.cookies, null, 2));
phantom.exit();
});
</pre>
<p><strong>More input events</strong></p>
<p>PhantomJS can send input events to a web page. This not a DOM event, it is more like a real user input in a web browser.</p>
<p>In this version, a mouse event can now explicitly specify the button corresponding to the event: <code>middle</code> or <code>right</code> (otherwise it is left by default). In addition, <code>doubleclick</code> event type is also supported. The following code fragment demonstrates sending a right-click:</p>
<pre class="prettyprint lang-js">
page.open(url, function () {
page.sendEvent('mousepress', 50, 100, 'right');
});
</pre>
<p>Beside mouse events, finally you can also trigger keyboard-related events: <code>keyup</code>, <code>keydown</code>, and <code>keypress</code>. For any of these events, a character or a string needs to be passed as in the following code fragment:</p>
<pre class="prettyprint lang-js">
page.open(url, function () {
page.sendEvent('keypress', 'A'); // send one char
page.sendEvent('keypress', 'PhantomJS'); // send a sequence of characters
});
</pre>
<p><strong>New features</strong></p>
<ul>
<li>Added a module system modelled after CommonJS/Node.js (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=47">47</a>)
<li>Added support for window pop-up (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=151">151</a>)
<li>Static build on Linux (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=413">413</a>)
<li>Added run-time detection of SSL support (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=484">484</a>)
<li>Added more events support (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=492">492</a>, <a href="http://code.google.com/p/phantomjs/issues/detail?id=712">712</a>)
<li>Added support for disabling automatic proxy detection (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=580">580</a>)
<li>Provided page closing callback (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=678">678</a>)
<li>Added methods to access URL, frames URL, frame Content (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=758">758</a>)
<li>Added more cookies-related API (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=761">761</a>)
</ul>
<p><strong>Improvements</strong></p>
<ul>
<li>Refactored command-line options handling (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=55">55</a>)
<li>Improved the workflow for producing release builds (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=599">599</a>)
<li>Improved cookies API and implementation (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=603">603</a>, <a href="http://code.google.com/p/phantomjs/issues/detail?id=761">761</a>)
<li>Improved frame switching API (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=654">654</a>)
<li>Fixed iframe handling regression (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=683">683</a>)
<li>Fixed OS version number with Windows 8 and Mountain Lion (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=684">684</a>, <a href="http://code.google.com/p/phantomjs/issues/detail?id=688">688</a>)
<li>Fixed HAR navigation info in the netsniff example (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=733">733</a>)
<li>Fixed compile warnings with Visual Studio (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=744">744</a>)
<li>Removed hacks for static linking on Windows (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=753">753</a>)
<li>Added ICO image handling on Windows (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=799">779</a>)
<li>Fixed font antialiasing on Windows (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=785">785</a>)
<li>Improved Jasmine test runner for Jasmine 1.2 (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=792">792</a>)
</ul>
<p><strong>Known Issues on Microsoft Windows</strong></p>
<ul>
<li>Very slow network performance. The workaround is to set <a href="https://github.com/ariya/phantomjs/wiki/API-Reference#wiki-command-line-options">proxy type</a> to "<tt>none</tt>" (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=580">580</a>)
<li>Some graphics drivers may cause mysterious crash (issue <a href="http://code.google.com/p/phantomjs/issues/detail?id=845">845</a>)
</ul>
<p>Back to <a href="releases.html">all releases</a>.</p>
</div>
</div>
<div id="footer">
<div id="footer-content" class="container_12">
<p>
© Copyright 2010-2013 <a href="http://twitter.com/AriyaHidayat">Ariya Hidayat</a> — Website design by <a href="http://svay.com/">Maurice Svay</a>
</p>
</div>
</div>
</body>
</html>