Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Enable localStorage.

Surprisingly, this makes the JS api work, but doesn't actually store
anything.
  • Loading branch information...
commit e8251c836b88415336853852a3a3c46f0fff4780 1 parent 0640b5e
Matt Burke authored
6  src/WebPage.cpp
@@ -4,12 +4,14 @@
4 4
 #include "NetworkCookieJar.h"
5 5
 #include "UnsupportedContentHandler.h"
6 6
 #include <QResource>
  7
+#include <QWebSettings>
7 8
 #include <iostream>
8 9
 
9 10
 WebPage::WebPage(QObject *parent) : QWebPage(parent) {
10 11
   setForwardUnsupportedContent(true);
11 12
   loadJavascript();
12 13
   setUserStylesheet();
  14
+  enableLocalStorage();
13 15
 
14 16
   m_loading = false;
15 17
   this->setCustomNetworkAccessManager();
@@ -23,6 +25,10 @@ WebPage::WebPage(QObject *parent) : QWebPage(parent) {
23 25
   this->setViewportSize(QSize(1680, 1050));
24 26
 }
25 27
 
  28
+void WebPage::enableLocalStorage() {
  29
+  settings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
  30
+}
  31
+
26 32
 void WebPage::setCustomNetworkAccessManager() {
27 33
   NetworkAccessManager *manager = new NetworkAccessManager();
28 34
   manager->setCookieJar(new NetworkCookieJar());
1  src/WebPage.h
@@ -49,6 +49,7 @@ class WebPage : public QWebPage {
49 49
     QString getLastAttachedFileName();
50 50
     void loadJavascript();
51 51
     void setUserStylesheet();
  52
+    void enableLocalStorage();
52 53
     int m_lastStatus;
53 54
     QString m_pageHeaders;
54 55
     bool m_ignoreSslErrors;

0 notes on commit e8251c8

Please sign in to comment.
Something went wrong with that request. Please try again.