Use offline app cache support when ./tmp/ exists
In Rails projects it's a sure bet that tmp exists so this automatically covers most people. With the README addition other people know to create the directory.
This commit is contained in:
parent
51b68f34d3
commit
a9073703dd
|
@ -76,6 +76,13 @@ If you're using capybara-webkit with Sinatra, don't forget to set
|
|||
Capybara.app = MySinatraApp.new
|
||||
```
|
||||
|
||||
Offline Application Cache
|
||||
-------------------------
|
||||
|
||||
The offline application cache needs a directory to write to for the cached files. Capybara-webkit
|
||||
will look at if the working directory has a tmp directory and when it exists offline application
|
||||
cache will be enabled.
|
||||
|
||||
Non-Standard Driver Methods
|
||||
---------------------------
|
||||
|
||||
|
|
|
@ -40,8 +40,11 @@ WebPage::WebPage(WebPageManager *manager, QObject *parent) : QWebPage(parent) {
|
|||
settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, true);
|
||||
settings()->setAttribute(QWebSettings::JavascriptCanCloseWindows, true);
|
||||
settings()->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, true);
|
||||
|
||||
if(QFileInfo("tmp").isDir()) {
|
||||
settings()->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, true);
|
||||
settings()->setOfflineWebApplicationCachePath("tmp");
|
||||
}
|
||||
|
||||
createWindow();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue