mirror of https://github.com/vitalif/phantomjs
Remove setting and command-line option for plugins loading.
http://code.google.com/p/phantomjs/issues/detail?id=4181.6
parent
ac771a22b9
commit
14b1ec6688
|
@ -74,14 +74,6 @@ void Config::processArgs(const QStringList &args)
|
||||||
setAutoLoadImages(false);
|
setAutoLoadImages(false);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (arg == "--load-plugins=yes") {
|
|
||||||
setPluginsEnabled(true);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (arg == "--load-plugins=no") {
|
|
||||||
setPluginsEnabled(false);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (arg == "--disk-cache=yes") {
|
if (arg == "--disk-cache=yes") {
|
||||||
setDiskCacheEnabled(true);
|
setDiskCacheEnabled(true);
|
||||||
continue;
|
continue;
|
||||||
|
@ -282,16 +274,6 @@ void Config::setOutputEncoding(const QString &value)
|
||||||
m_outputEncoding = value;
|
m_outputEncoding = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Config::pluginsEnabled() const
|
|
||||||
{
|
|
||||||
return m_pluginsEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Config::setPluginsEnabled(const bool value)
|
|
||||||
{
|
|
||||||
m_pluginsEnabled = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString Config::proxyType() const
|
QString Config::proxyType() const
|
||||||
{
|
{
|
||||||
return m_proxyType;
|
return m_proxyType;
|
||||||
|
@ -473,7 +455,6 @@ void Config::resetToDefaults()
|
||||||
m_ignoreSslErrors = false;
|
m_ignoreSslErrors = false;
|
||||||
m_localToRemoteUrlAccessEnabled = false;
|
m_localToRemoteUrlAccessEnabled = false;
|
||||||
m_outputEncoding = "UTF-8";
|
m_outputEncoding = "UTF-8";
|
||||||
m_pluginsEnabled = false;
|
|
||||||
m_proxyType = "http";
|
m_proxyType = "http";
|
||||||
m_proxyHost.clear();
|
m_proxyHost.clear();
|
||||||
m_proxyPort = 1080;
|
m_proxyPort = 1080;
|
||||||
|
|
|
@ -44,7 +44,6 @@ class Config: QObject
|
||||||
Q_PROPERTY(bool ignoreSslErrors READ ignoreSslErrors WRITE setIgnoreSslErrors)
|
Q_PROPERTY(bool ignoreSslErrors READ ignoreSslErrors WRITE setIgnoreSslErrors)
|
||||||
Q_PROPERTY(bool localToRemoteUrlAccessEnabled READ localToRemoteUrlAccessEnabled WRITE setLocalToRemoteUrlAccessEnabled)
|
Q_PROPERTY(bool localToRemoteUrlAccessEnabled READ localToRemoteUrlAccessEnabled WRITE setLocalToRemoteUrlAccessEnabled)
|
||||||
Q_PROPERTY(QString outputEncoding READ outputEncoding WRITE setOutputEncoding)
|
Q_PROPERTY(QString outputEncoding READ outputEncoding WRITE setOutputEncoding)
|
||||||
Q_PROPERTY(bool pluginsEnabled READ pluginsEnabled WRITE setPluginsEnabled)
|
|
||||||
Q_PROPERTY(QString proxyType READ proxyType WRITE setProxyType)
|
Q_PROPERTY(QString proxyType READ proxyType WRITE setProxyType)
|
||||||
Q_PROPERTY(QString proxy READ proxy WRITE setProxy)
|
Q_PROPERTY(QString proxy READ proxy WRITE setProxy)
|
||||||
Q_PROPERTY(QString proxyAuth READ proxyAuth WRITE setProxyAuth)
|
Q_PROPERTY(QString proxyAuth READ proxyAuth WRITE setProxyAuth)
|
||||||
|
@ -79,9 +78,6 @@ public:
|
||||||
QString outputEncoding() const;
|
QString outputEncoding() const;
|
||||||
void setOutputEncoding(const QString &value);
|
void setOutputEncoding(const QString &value);
|
||||||
|
|
||||||
bool pluginsEnabled() const;
|
|
||||||
void setPluginsEnabled(const bool value);
|
|
||||||
|
|
||||||
QString proxyType() const;
|
QString proxyType() const;
|
||||||
void setProxyType(const QString value);
|
void setProxyType(const QString value);
|
||||||
|
|
||||||
|
@ -141,7 +137,6 @@ private:
|
||||||
bool m_ignoreSslErrors;
|
bool m_ignoreSslErrors;
|
||||||
bool m_localToRemoteUrlAccessEnabled;
|
bool m_localToRemoteUrlAccessEnabled;
|
||||||
QString m_outputEncoding;
|
QString m_outputEncoding;
|
||||||
bool m_pluginsEnabled;
|
|
||||||
QString m_proxyType;
|
QString m_proxyType;
|
||||||
QString m_proxyHost;
|
QString m_proxyHost;
|
||||||
int m_proxyPort;
|
int m_proxyPort;
|
||||||
|
|
|
@ -52,7 +52,6 @@
|
||||||
"document.body.appendChild(el);"
|
"document.body.appendChild(el);"
|
||||||
|
|
||||||
#define PAGE_SETTINGS_LOAD_IMAGES "loadImages"
|
#define PAGE_SETTINGS_LOAD_IMAGES "loadImages"
|
||||||
#define PAGE_SETTINGS_LOAD_PLUGINS "loadPlugins"
|
|
||||||
#define PAGE_SETTINGS_JS_ENABLED "javascriptEnabled"
|
#define PAGE_SETTINGS_JS_ENABLED "javascriptEnabled"
|
||||||
#define PAGE_SETTINGS_XSS_AUDITING "XSSAuditingEnabled"
|
#define PAGE_SETTINGS_XSS_AUDITING "XSSAuditingEnabled"
|
||||||
#define PAGE_SETTINGS_USER_AGENT "userAgent"
|
#define PAGE_SETTINGS_USER_AGENT "userAgent"
|
||||||
|
|
|
@ -113,7 +113,6 @@ Phantom::Phantom(QObject *parent)
|
||||||
SLOT(onInitialized()));
|
SLOT(onInitialized()));
|
||||||
|
|
||||||
m_defaultPageSettings[PAGE_SETTINGS_LOAD_IMAGES] = QVariant::fromValue(m_config.autoLoadImages());
|
m_defaultPageSettings[PAGE_SETTINGS_LOAD_IMAGES] = QVariant::fromValue(m_config.autoLoadImages());
|
||||||
m_defaultPageSettings[PAGE_SETTINGS_LOAD_PLUGINS] = QVariant::fromValue(m_config.pluginsEnabled());
|
|
||||||
m_defaultPageSettings[PAGE_SETTINGS_JS_ENABLED] = QVariant::fromValue(true);
|
m_defaultPageSettings[PAGE_SETTINGS_JS_ENABLED] = QVariant::fromValue(true);
|
||||||
m_defaultPageSettings[PAGE_SETTINGS_XSS_AUDITING] = QVariant::fromValue(false);
|
m_defaultPageSettings[PAGE_SETTINGS_XSS_AUDITING] = QVariant::fromValue(false);
|
||||||
m_defaultPageSettings[PAGE_SETTINGS_USER_AGENT] = QVariant::fromValue(m_page->userAgent());
|
m_defaultPageSettings[PAGE_SETTINGS_USER_AGENT] = QVariant::fromValue(m_page->userAgent());
|
||||||
|
|
|
@ -8,7 +8,6 @@ Options:
|
||||||
--disk-cache=[yes|no] Enables disk cache (at desktop services cache storage location, default is 'no')
|
--disk-cache=[yes|no] Enables disk cache (at desktop services cache storage location, default is 'no')
|
||||||
--ignore-ssl-errors=[yes|no] Ignores SSL errors (i.e. expired or self-signed certificate errors)
|
--ignore-ssl-errors=[yes|no] Ignores SSL errors (i.e. expired or self-signed certificate errors)
|
||||||
--load-images=[yes|no] Loads all inlined images (default is 'yes')
|
--load-images=[yes|no] Loads all inlined images (default is 'yes')
|
||||||
--load-plugins=[yes|no] Loads all plugins (i.e. 'Flash', 'Silverlight', ...) (default is 'no')
|
|
||||||
--local-to-remote-url-access=[yes|no] Local content can access remote URL (default is 'no')
|
--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)
|
--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')
|
--output-encoding Sets the encoding used for terminal output (default is 'utf8')
|
||||||
|
|
|
@ -206,7 +206,6 @@ void WebPage::applySettings(const QVariantMap &def)
|
||||||
QWebSettings *opt = m_webPage->settings();
|
QWebSettings *opt = m_webPage->settings();
|
||||||
|
|
||||||
opt->setAttribute(QWebSettings::AutoLoadImages, def[PAGE_SETTINGS_LOAD_IMAGES].toBool());
|
opt->setAttribute(QWebSettings::AutoLoadImages, def[PAGE_SETTINGS_LOAD_IMAGES].toBool());
|
||||||
opt->setAttribute(QWebSettings::PluginsEnabled, def[PAGE_SETTINGS_LOAD_PLUGINS].toBool());
|
|
||||||
opt->setAttribute(QWebSettings::JavascriptEnabled, def[PAGE_SETTINGS_JS_ENABLED].toBool());
|
opt->setAttribute(QWebSettings::JavascriptEnabled, def[PAGE_SETTINGS_JS_ENABLED].toBool());
|
||||||
opt->setAttribute(QWebSettings::XSSAuditingEnabled, def[PAGE_SETTINGS_XSS_AUDITING].toBool());
|
opt->setAttribute(QWebSettings::XSSAuditingEnabled, def[PAGE_SETTINGS_XSS_AUDITING].toBool());
|
||||||
opt->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, def[PAGE_SETTINGS_LOCAL_ACCESS_REMOTE].toBool());
|
opt->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, def[PAGE_SETTINGS_LOCAL_ACCESS_REMOTE].toBool());
|
||||||
|
|
Loading…
Reference in New Issue