phantomjs/release-1.4.html

169 lines
6.5 KiB
HTML
Executable File

<!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.4 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>
<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 pre {
margin-left: 2em;
}
#description ul {
line-height: 125%;
list-style-type: disc;
margin-left: 1em;
margin-bottom: 1em;
}
#description li {
margin-left: 1em;
}
</style>
</head>
<body>
<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.4 Release Notes</h1>
</div>
</div>
</div>
<div id="description" class="container_12">
<div class="grid_10">
<p>PhantomJS 1.4, <em><a href="release-names.html">Glory of the Snow</a></em>, was released on December 22, 2011. It is a minor update, mostly bug fixes and one new major feature: WebServer module.</p>
<p>This version is backward compatible with version 1.3. Existing scripts should work without any modification.</p>
<p>Minimum requirement to build PhantomJS 1.3 is Qt 4.6 or later. Latest stable release of Qt, i.e. version 4.8.0, is strongly recommended.</p>
<p><strong>WebServer module</strong></p>
<p>Note: This WebServer module is intended for ease of communication between PhantomJS scripts and the outside world. It is not recommended to use it as a general production server.</p>
<p>By using the embedded web server module <a href="https://github.com/valenok/mongoose">Mongoose</a>, PhantomJS script can start a web server which listens to a particular port.</p>
<p>A very simple example is as follows. It always gives the same response for any request.</p>
<pre>var server, service;
server = require('webserver').create();
service = server.listen(8080, function (request, response) {
response.statusCode = 200;
response.write('<html><body>Hello!</body></html>');
});
</pre>
<p>The request object passed to the callback function may contain the following properties:</p>
<ul>
<li>method defines the request method (GET, POST, ...)
<li>url contains the complete request URL, including the query string (if any)
<li>httpVersion has the actual HTTP version
<li>headers stores all HTTP headers as key-value pair
</ul>
<p>The response object should be used to create the response:</p>
<ul>
<li>statusCode sets the returned status code
<li>write sends a chunk for the response body (it can be called multiple times).
</ul>
<p>This WebServer module is still rather simple in this version. Depending on the needs, the functionalities and the corresponding API will be expanded in the next versions.</p>
<p><strong>Static version build script</strong></p>
<p>For continuous integration server and various other uses cases, often it is desired to have a static version of PhantomJS which has almost zero dependencies. While building PhantomJS for the static build is not difficult, it is often a daunting task to figure out the bits and pieces necessary to achieve that build.</p>
<p>For convenience, now there are two build scripts, available in the deploy subdirectories, each for Linux and Mac. The script automatically downloads the source code of Qt, build everything locally, and then prepare the binary for deployment. There is no need to have Qt installed on the system before running the script.</p>
<p>The produced binary has very minimal dependencies and can be transferred to another machine easily. With the help of UPX (optional), the size of the binary is only about 10 MB.</p>
<p>Note: Even with the static build, as of now you still need to setup Xvfb for the Linux version. Also for Mac, don't forget the Info.plist file (see issue 281).</p>
<p><strong>New features</strong></p>
<ul>
<li>Added embedded HTTP server (issue 115)</li>
<li>Added convenient build script for Linux (issue 197)</li>
<li>Added support for SOCKS5 proxy (issue 266)</li>
<li>Updated CoffeeScript compiler to version 1.2 (issue 312)</li>
</ul>
<p><strong>Bug fixes</strong></p>
<ul>
<li>Fix potential crash in QUrl with Qt 4.8 (issue 304)</li>
<li>Fix bug in CookieJar with QSettings and string (PyPhantomJS issue 10)</li>
<li>Prevent showing the icon on Mac OS X Dock (issue 281)</li>
</ul>
<p><strong>Examples</strong></p>
<ul>
<li>Added a new example to detect browsers sniffing (issue 263)</li>
<li>Added HTTP server example (issue 115)</li>
</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>
&copy; Copyright 2010-2012 <a href="http://twitter.com/AriyaHidayat">Ariya Hidayat</a> &mdash; Website design by <a href="http://svay.com/">Maurice Svay</a>
</p>
</div>
</div>
</body>
</html>