Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. LocalStorage and Javascript Interface support
Forum Updated to NodeBB v4.3 + New Features

LocalStorage and Javascript Interface support

Scheduled Pinned Locked Moved QtWebEngine
localstoragejavascriptinterface
2 Posts 1 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    amorawski
    wrote on 24 Mar 2015, 18:18 last edited by amorawski
    #1

    Hi,

    I'm working on the hybrid application with Qt. WebKit supports both localStorage and javascriptInterface, but I have no idea how to achieve similar features when deploying application for Android or iOS (which forces to use webview). Is there any way to make those features work? If not, do we know when they'll become available?

    Thanks in advance,
    art.

    A 1 Reply Last reply 13 Apr 2015, 06:22
    0
    • A amorawski
      24 Mar 2015, 18:18

      Hi,

      I'm working on the hybrid application with Qt. WebKit supports both localStorage and javascriptInterface, but I have no idea how to achieve similar features when deploying application for Android or iOS (which forces to use webview). Is there any way to make those features work? If not, do we know when they'll become available?

      Thanks in advance,
      art.

      A Offline
      A Offline
      amorawski
      wrote on 13 Apr 2015, 06:22 last edited by
      #2

      @amorawski Hi,

      if anybody would be interested in this - I didn't find any other way then by using native system browsers. Basically you need to extend the QQuickItem, then on iOS you can create the browser using ObjectiveC (using PlatformNativeInterface), on Android you need to use JNI (so you create native view on top of the QtView). Cool thing is that even animations work in both cases (on android you need to synchronize WebView position with the QQuickItem position beeing rendered on the QtView).

      For communication with javascript - for android you can use addJavascriptInterface, for iOS the best solution I have found is passing the params though URL on hidden iframe, and catching Load event on native side, fetching params from the URL).

      Cheers,
      art.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved