Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. [Qt 5.3] Replacing the window JS object or trace member access
Forum Updated to NodeBB v4.3 + New Features

[Qt 5.3] Replacing the window JS object or trace member access

Scheduled Pinned Locked Moved Qt WebKit
3 Posts 2 Posters 1.2k 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.
  • C Offline
    C Offline
    Chris79
    wrote on last edited by
    #1

    Hi all,

    currently I'm doing some deep dive into the webkit javascript bridge. For some research work I want to be able to register if a webpage accesses members of the javascript window object.

    My first attemp was to replace the entire window object with a QObject derived implementation. But this seems not to work using QWebFrame::addToJavaScriptWindowObject if I set the name to "window". If I set the name to "window2" it works - so I think it's simply not possible to overwrite the window object.

    Now if I dig deeper to QtWebKit, do you have any pointers for me where I can start looking for a place where I can maybe modify the default window object implementation? Any suggestions are welcome :-)

    Best
    Chris

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Chris79
      wrote on last edited by
      #2

      I figured out I can hook up in the WebKit class DOMWindow (e. g. DOMWindow::outerHeight() which is window.outerHeight property in JS).

      I now try to figure out how to connect a slot of my class to a signal emitted in outerHeight(). Is there a good way to access the instance of DOMWindowf for the current page? Again, any suggestions are welcome :-)

      1 Reply Last reply
      0
      • B Offline
        B Offline
        brcontainer
        wrote on last edited by
        #3

        Tried use "QWebFrame::evaluateScript" ?

        QT project: https://github.com/brcontainer/qt-helper

        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