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. QWebEngine - how to catch execution of any javascripts from C++
Qt 6.11 is out! See what's new in the release blog

QWebEngine - how to catch execution of any javascripts from C++

Scheduled Pinned Locked Moved Unsolved QtWebEngine
3 Posts 3 Posters 897 Views
  • 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.
  • K Offline
    K Offline
    Kobid
    wrote on last edited by
    #1

    I know how to communicate between C++ and Javascript in Qt WebEngine from this tutorial: https://myprogrammingnotes.com/communication-c-javascript-qt-webengine.html

    But that is a case when I'm the author of loaded page so C++ and HTML parts are programmed by me. But is it possible to catch any javascript executed on any page loaded (like google.com etc)? Some kind of signal emitted when JS is executed so I could investigate function name and input args. QWebEnginePage->QWebEngineScriptCollection->scripts() return only my own injected scripts, it doesn't contain page scripts.

    Regards

    JonBJ 1 Reply Last reply
    0
    • S Offline
      S Offline
      Salamander
      wrote on last edited by Salamander
      #2

      It seems the QWebEngine topic is inactive. Maybe you should post your question on the stackoverflow.

      1 Reply Last reply
      0
      • K Kobid

        I know how to communicate between C++ and Javascript in Qt WebEngine from this tutorial: https://myprogrammingnotes.com/communication-c-javascript-qt-webengine.html

        But that is a case when I'm the author of loaded page so C++ and HTML parts are programmed by me. But is it possible to catch any javascript executed on any page loaded (like google.com etc)? Some kind of signal emitted when JS is executed so I could investigate function name and input args. QWebEnginePage->QWebEngineScriptCollection->scripts() return only my own injected scripts, it doesn't contain page scripts.

        Regards

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @Kobid
        As a general answer to the question as phrased, I would imagine the answer is "no". QtWebEngine is a wrapper to Chromium, and I don't think that is going to have a facility for "Some kind of signal emitted when JS is executed".

        However, if your purpose is to figure what is going on interactively when you are using it and have a look at arguments etc., you could use a JS debugger. See https://stackoverflow.com/questions/28681141/qtwebengine-debugging, which shows people bringing up the Developer Tools debugger or a FireBug one, or similar.

        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