Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-64047

QtWebEngine and localStorage

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P4: Low
    • None
    • 5.9.1, 5.9.2, 5.10.0 Beta 2
    • WebEngine
    • None

    Description

      Hello, found interest trouble, when i open some page:

      // code placeholder
      MainWindow::MainWindow(QWidget *parent) :  QMainWindow(parent), ui(new Ui::MainWindow)
      {
          ui->setupUi(this);
        
          web_view = new QWebEngineView(this);
          web_view->setContextMenuPolicy( Qt::NoContextMenu);
          WebPage *pg = new WebPage();
      
      
          QWebEngineProfile *profile = QWebEngineProfile::defaultProfile();
          profile->setCachePath("/tmp/arm");
          profile->setPersistentStoragePath("/tmp/arm");
      
          QWebEngineSettings *ws = QWebEngineSettings::defaultSettings();
          pg->settings()->setAttribute(QWebEngineSettings::WebGLEnabled, true);
          pg->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);
          pg->settings()->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, true);
          pg->settings()->setAttribute(QWebEngineSettings::JavascriptCanAccessClipboard, true);
          pg->settings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, true);
          pg->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
          pg->settings()->setAttribute(QWebEngineSettings::AutoLoadImages,true);
      
      
          web_view->setPage(pg);    
          web_view->load(QUrl("http://mysite.ru"));
      
          setCentralWidget(web_view);
      
      
      }
      
      
      

      and in javasript try save localstorage

      // code placeholder
      <script> if(localStorage.getItem("login") == null) { localStorage.setItem("login","test"); } </script>

      value in localStorage not overwrite  or saved 2 symbol, or clear full, but not save normally value in localStorage. Tell me please maybe im do some wrong?

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt_webengine_team Qt WebEngine Team
            igor_kvyatkovsky Igor
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes