← Back to team overview

ubuntu-webapps-bugs team mailing list archive

[Bug 1574517] Re: Ubuntu.Web doesn't support WebViewLoadRequest

 

The documentation you’re referring to is not for the Ubuntu WebView,
it’s for the QtWebEngine WebView (although both have similar APIs, not
everything works exactly the same).

But you can achieve what you’re after with the following code:

  WebView {
    onLoadEvent: {
      if (event.type == LoadEvent.TypeStarted) {
        console.log("loading")
      } else if (event.type == LoadEvent.TypeSucceeded) {
        console.log("loading succeeded")
      } else if (event.type == LoadEvent.TypeFailed) {
        console.log("loading failed")
      }
    }
  }

** Changed in: oxide
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
WebApps bug tracking, which is subscribed to Oxide.
https://bugs.launchpad.net/bugs/1574517

Title:
  Ubuntu.Web doesn't support WebViewLoadRequest

Status in Oxide:
  Invalid

Bug description:
  I'd like to implement a fallback site when loading failed. According
  to the docs QML should support a loadingChanged-signal [1] and a
  WebViewLoadRequest [2] which results in a minimal example like this:

                  onLoadingChanged: {
                       if (loadRequest.status === WebLoadStatus.Started) {
                           console.log("loading")
                      } else if (loadRequest.status === WebLoadStatus.Succeeded) {
                           console.log("loading succeeded")
                      } else if (loadRequest.status === WebLoadStatus.Failed) {
                          // If loading failed, fallback a local html file
                           console.log("loading failed")
                      }
                  }

  Unfortunately this doesn't work / is not implemented (yet?) in Ubuntu
  WebView (Ubuntu.Web 0.2) [3]. I got a reference error "loadRequest is
  not defined"

  
  [1] http://doc.qt.io/qt-5/qml-qtwebview-webview.html#loadingChanged-signal
  [2] http://doc.qt.io/qt-5/qml-qtwebview-webviewloadrequest.html
  [3] https://developer.ubuntu.com/api/apps/qml/sdk-15.04.5/Ubuntu.Web.WebView/

To manage notifications about this bug go to:
https://bugs.launchpad.net/oxide/+bug/1574517/+subscriptions


References