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. In WebEngineView how can ignore a request ?
Forum Updated to NodeBB v4.3 + New Features

In WebEngineView how can ignore a request ?

Scheduled Pinned Locked Moved QtWebEngine
3 Posts 3 Posters 1.8k 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.
  • G Offline
    G Offline
    Gianluca
    wrote on 16 Dec 2014, 17:21 last edited by
    #1

    On WebView it’s possible to do:
    @
    onNavigationRequested: {
    // detect URL scheme prefix, most likely an external link
    var schemaRE = /^\w+:/;
    if (schemaRE.test(request.url)) {
    request.action = WebView.AcceptRequest;
    } else {
    request.action = WebView.IgnoreRequest;
    // delegate request.url here
    }
    }
    @
    but I can’t see on the documentation a way to do the same with the new WebEngineView
    Is It possible ?

    Thanks,
    Gianluca.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DanielRMueller
      wrote on 5 Jan 2015, 15:25 last edited by
      #2

      We're facing the same problem now. We haven't implemented a proper solution yet, but one option that we discussed was using JavaScript for this purpose. (The other is changing the website we're having this issue with, but that is probably not a solution for you.)

      I am not a JavaScript developer myself so i don't know the specifics, but apparently this is something that is possible in the HTML/JavaScript world of the web, and so you may just need a different approach.

      Hopefully someone else can give more specific advice, but maybe this is already enough to get you on the right track.

      1 Reply Last reply
      0
      • W Offline
        W Offline
        whitecastleroad
        wrote on 9 Jan 2015, 21:09 last edited by
        #3

        Anyone ever solve this issue? I wound up using QML to take advantage of the onNavigationRequested event to hijack (and cancel) the navigation, which solves this immediate problem. However, this solution is not working for me as a whole since I cannot figure out how to run javascript in the WebEngineView when it is created in QML, which is my second requirement. :(

        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