mirror of https://github.com/vitalif/phantomjs
Compare commits
16 Commits
Author | SHA1 | Date |
---|---|---|
Ariya Hidayat | cbc9be0a7f | |
Ariya Hidayat | 1ee0a4ce44 | |
Ariya Hidayat | fa4309e381 | |
Ariya Hidayat | 724d28863b | |
Ariya Hidayat | bfc16995b4 | |
Ariya Hidayat | 3c13b9dca1 | |
Ariya Hidayat | c32d78747c | |
Ariya Hidayat | 62811468e4 | |
Ariya Hidayat | eb33e89e7a | |
Ariya Hidayat | f4f59b2319 | |
Ariya Hidayat | 56a5641b0e | |
Ariya Hidayat | cd590f2524 | |
Ariya Hidayat | 2e2fef788d | |
Ariya Hidayat | dea72dcbd3 | |
Ariya Hidayat | ec57f2e2f1 | |
Ariya Hidayat | d6219e16d6 |
|
@ -28,6 +28,6 @@ Do not forget to consult the concise [API Reference](http://code.google.com/p/ph
|
|||
|
||||
PhantomJS is based on [Qt](http://qt.nokia.com). There are two implementations, using C++ and Python.
|
||||
|
||||
The latest [stable release](http://code.google.com/p/phantomjs/wiki/ReleaseNotes) is version 1.3 ("Water Lily").
|
||||
The latest [stable release](http://code.google.com/p/phantomjs/wiki/ReleaseNotes) is version 1.4 ("Glory of the Snow").
|
||||
|
||||
If you want to contribute, please read the [Contribution Guide](http://code.google.com/p/phantomjs/wiki/ContributionGuide).
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
QT_VERSION=0
|
||||
QT_FOLDER=""
|
||||
COMPILE_JOBS=10
|
||||
COMPILE_JOBS=4
|
||||
|
||||
if [ "$1" = "--qt-4.8" ]
|
||||
then
|
||||
|
|
|
@ -37,13 +37,74 @@ cd $QT_FOLDER
|
|||
patch configure ../allow-static-qtwebkit.patch
|
||||
patch -p1 < ../qapplication_skip_qtmenu.patch
|
||||
|
||||
rm -rf src/3rdparty/WebKit/qt/tests
|
||||
rm -rf src/3rdparty/webkit/Source/WebKit/qt/tests
|
||||
|
||||
# Step 4: Build Qt
|
||||
|
||||
echo "Building Qt $QT_VERSION. Please wait..."
|
||||
echo
|
||||
./configure -opensource -confirm-license -release -static -no-exceptions -no-stl -no-xmlpatterns -no-phonon -no-qt3support -no-opengl -no-declarative -qt-libpng -qt-libjpeg -no-libmng -no-libtiff -D QT_NO_STYLE_CDE -D QT_NO_STYLE_CLEANLOOKS -D QT_NO_STYLE_MOTIF -D QT_NO_STYLE_PLASTIQUE -cocoa -prefix $PWD -arch x86 -nomake demos -nomake examples -nomake tools
|
||||
|
||||
CFG=''
|
||||
|
||||
CFG+=' -opensource' # Use the open-source license
|
||||
CFG+=' -confirm-license' # Silently acknowledge the license confirmation
|
||||
|
||||
CFG+=' -release' # Build only for release (no debugging support)
|
||||
CFG+=' -static' # Compile for static libraries
|
||||
CFG+=' -fast' # Accelerate Makefiles generation
|
||||
CFG+=' -nomake demos' # Don't build with the demos
|
||||
CFG+=' -nomake docs' # Don't generate the documentatio
|
||||
CFG+=' -nomake examples' # Don't build any examples
|
||||
CFG+=' -nomake translations' # Ignore the translations
|
||||
CFG+=' -nomake tools' # Don't built the tools
|
||||
|
||||
CFG+=' -no-exceptions' # Don't use C++ exception
|
||||
CFG+=' -no-stl' # No need for STL compatibility
|
||||
|
||||
# Irrelevant Qt features
|
||||
CFG+=' -no-libmng'
|
||||
CFG+=' -no-libtiff'
|
||||
|
||||
# Unnecessary Qt modules
|
||||
CFG+=' -no-declarative'
|
||||
CFG+=' -no-multimedia'
|
||||
CFG+=' -no-opengl'
|
||||
CFG+=' -no-openvg'
|
||||
CFG+=' -no-phonon'
|
||||
CFG+=' -no-qt3support'
|
||||
CFG+=' -no-script'
|
||||
CFG+=' -no-scripttools'
|
||||
CFG+=' -no-svg'
|
||||
CFG+=' -no-xmlpatterns'
|
||||
|
||||
# Sets the default graphics system to the raster engine
|
||||
CFG+=' -graphicssystem raster'
|
||||
|
||||
# Mac
|
||||
CFG+=' -cocoa' # Cocoa only, ignore Carbon
|
||||
CFG+=' -no-cups' # Disable CUPS support
|
||||
CFG+=' -no-dwarf2'
|
||||
|
||||
# Unix
|
||||
CFG+=' -no-dbus' # Disable D-Bus feature
|
||||
CFG+=' -no-glib' # No need for Glib integration
|
||||
CFG+=' -no-gstreamer' # Turn off GStreamer support
|
||||
CFG+=' -no-gtkstyle' # Disable theming integration with Gtk+
|
||||
CFG+=' -no-sm'
|
||||
CFG+=' -no-xinerama'
|
||||
CFG+=' -no-xkb'
|
||||
|
||||
# Use the bundled libraries, vs system-installed
|
||||
CFG+=' -qt-libjpeg'
|
||||
CFG+=' -qt-libpng'
|
||||
|
||||
# Useless styles
|
||||
CFG+=' -D QT_NO_STYLESHEET'
|
||||
CFG+=' -D QT_NO_STYLE_CDE'
|
||||
CFG+=' -D QT_NO_STYLE_CLEANLOOKS'
|
||||
CFG+=' -D QT_NO_STYLE_MOTIF'
|
||||
|
||||
./configure -prefix $PWD $CFG -arch x86
|
||||
make -j$COMPILE_JOBS
|
||||
cd ..
|
||||
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
var page = require('webpage').create();
|
||||
var server = require('webserver').create();
|
||||
var host, port;
|
||||
|
||||
if (phantom.args.length !== 1) {
|
||||
console.log('Usage: server.js <some port>');
|
||||
phantom.exit();
|
||||
} else {
|
||||
port = phantom.args[0];
|
||||
var listening = server.listen(port, function (request, response) {
|
||||
console.log("GOT HTTP REQUEST");
|
||||
console.log("request.url = " + request.url);
|
||||
console.log("request.queryString = " + request.queryString);
|
||||
console.log("request.method = " + request.method);
|
||||
console.log("request.httpVersion = " + request.httpVersion);
|
||||
console.log("request.statusCode = " + request.statusCode);
|
||||
console.log("request.isSSL = " + request.isSSL);
|
||||
console.log("request.remoteIP = " + request.remoteIP);
|
||||
console.log("request.remotePort = " + request.remotePort);
|
||||
console.log("request.remoteUser = " + request.remoteUser);
|
||||
console.log("request.headers = " + request.headers);
|
||||
for(var i = 0; i < request.headers; ++i) {
|
||||
console.log("request.headerName(" + i + ") = " + request.headerName(i));
|
||||
console.log("request.headerValue(" + i + ") = " + request.headerValue(i));
|
||||
}
|
||||
|
||||
// we set the headers here
|
||||
response.statusCode = 200;
|
||||
response.headers = {"Cache": "no-cache", "Content-Type": "text/html"};
|
||||
// this is also possible:
|
||||
response.setHeader("foo", "bar");
|
||||
// now we write the body
|
||||
// note: the headers above will now be sent implictly
|
||||
response.write("<html><head><title>YES!</title></head>");
|
||||
// note: writeBody can be called multiple times
|
||||
response.write("<body><p>pretty cool :)</body></html>");
|
||||
});
|
||||
if (!listening) {
|
||||
console.log("could not create web server listening on port " + port);
|
||||
phantom.exit();
|
||||
}
|
||||
var url = "http://localhost:" + port + "/foo/bar.php?asdf=true";
|
||||
console.log(url);
|
||||
page.open(url, function (status) {
|
||||
if (status !== 'success') {
|
||||
console.log('FAIL to load the address');
|
||||
} else {
|
||||
console.log(page.content);
|
||||
}
|
||||
phantom.exit();
|
||||
});
|
||||
}
|
|
@ -55,4 +55,3 @@ function require(name) {
|
|||
|
||||
// Legacy way to use WebPage
|
||||
window.WebPage = require('webpage').create;
|
||||
window.WebServer = require('webserver').create;
|
||||
|
|
|
@ -60,7 +60,7 @@ Phantom::Phantom(QObject *parent)
|
|||
|
||||
if (m_config.versionFlag()) {
|
||||
m_terminated = true;
|
||||
Terminal::instance()->cout(QString("%1 (development)").arg(PHANTOMJS_VERSION_STRING));
|
||||
Terminal::instance()->cout(QString("%1").arg(PHANTOMJS_VERSION_STRING));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@ Options:
|
|||
--local-to-remote-url-access=[yes|no] Local content can access remote URL (default is 'no')
|
||||
--max-disk-cache-size=size Limits the size of disk cache (in KB)
|
||||
--output-encoding Sets the encoding used for terminal output (default is 'utf8')
|
||||
--remote-debugger-port=port Starts the script in a debug harness and listens on the desired port.
|
||||
--proxy=address:port Sets the network proxy (e.g. "--proxy=192.168.1.42:8080")
|
||||
--proxy-type=[http|socks5] Sets the proxy type, either "http" (default) or "socks5"
|
||||
--script-encoding Sets the encoding used for the starting script (default is 'utf8')
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
describe("WebServer constructor", function() {
|
||||
it("should exist in window", function() {
|
||||
expect(window.hasOwnProperty('WebServer')).toBeTruthy();
|
||||
it("should not exist in window", function() {
|
||||
expect(window.hasOwnProperty('WebServer')).toBeFalsy();
|
||||
});
|
||||
|
||||
it("should be a function", function() {
|
||||
expect(typeof window.WebServer).toEqual('function');
|
||||
var WebServer = require('webserver').create;
|
||||
expect(typeof WebServer).toEqual('function');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -31,7 +32,7 @@ function checkRequest(request, response) {
|
|||
}
|
||||
|
||||
describe("WebServer object", function() {
|
||||
var server = new WebServer();
|
||||
var server = require('webserver').create();
|
||||
|
||||
it("should be creatable", function() {
|
||||
expect(typeof server).toEqual('object');
|
||||
|
|
Loading…
Reference in New Issue