From 9c74adeecad6722cdbfd93fbfd8ab9db0965aecb Mon Sep 17 00:00:00 2001 From: Ivan De Marino Date: Mon, 28 Feb 2011 23:17:59 +0000 Subject: [PATCH] Enhanced the "usage" message and fixed misdocumented behaviour of "--load-plugins" * Now the "usage" shows all the options that are currently supported by phantomjs from the command line * The default behaviour for the option "--load-plugins" is now fixed (to "no") --- .gitignore | 1 + src/phantomjs.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..75c107bc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pro.user diff --git a/src/phantomjs.cpp b/src/phantomjs.cpp index 4cad83ba..414ffa6f 100644 --- a/src/phantomjs.cpp +++ b/src/phantomjs.cpp @@ -45,7 +45,12 @@ void showUsage() { - std::cerr << "phantomjs script.js" << std::endl << std::endl; + std::cerr << "Usage: phantomjs [options] script.js [argument [argument ...]]" << std::endl << std::endl; + std::cerr << "Options:" << std::endl; + std::cerr << "\t--load-images=[yes|no]\t\tLoad all inlined images (default is 'yes')." << std::endl; + std::cerr << "\t--load-plugins=[yes|no]\tLoad all plugins (i.e. 'Flash', 'Silverlight', ...) (default is 'no')." << std::endl; + std::cerr << "\t--upload-file fileId=/file/path\tUpload a file by creating a ''\n" + "\t\t\t\tand calling phantom.setFormInputFile(document.getElementById('foo', 'fileId')." << std::endl; } class WebPage: public QWebPage @@ -175,7 +180,7 @@ Phantom::Phantom(QObject *parent) m_page.setPalette(palette); bool autoLoadImages = true; - bool pluginsEnabled = true; + bool pluginsEnabled = false; // second argument: script name QStringList args = QApplication::arguments();