From 88d679406578ee51b8163453dff08827e83dac8b Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Tue, 28 Dec 2010 00:05:50 -0800 Subject: [PATCH] Start with an empty but sensible document.body object. --- src/phantomjs.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/phantomjs.cpp b/src/phantomjs.cpp index f86cf02d..c894a097 100644 --- a/src/phantomjs.cpp +++ b/src/phantomjs.cpp @@ -149,6 +149,9 @@ Phantom::Phantom(QObject *parent) m_page.settings()->setAttribute(QWebSettings::LocalStorageEnabled, true); m_page.settings()->setLocalStoragePath(QDesktopServices::storageLocation(QDesktopServices::DataLocation)); m_page.settings()->setOfflineStoragePath(QDesktopServices::storageLocation(QDesktopServices::DataLocation)); + + // Ensure we have document.body. + m_page.mainFrame()->setHtml(""); } QStringList Phantom::arguments() const