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. Injecting Javascript into all webpages.
Forum Updated to NodeBB v4.3 + New Features

Injecting Javascript into all webpages.

Scheduled Pinned Locked Moved Unsolved QtWebEngine
2 Posts 1 Posters 327 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.
  • T Offline
    T Offline
    Tylnesh
    wrote on 29 Nov 2020, 21:39 last edited by
    #1

    Hey all! Looking for a way to inject a javascript eyetracking library into all webpages opened in my qt webengine based browser. I've tried adding it as a source file to my project, but that prevents me from building the project, as the library calls onto window, document and other objects not usually available to Javascript in Qt.

    After that I've tried to inject it using webengine script like this:

     WebEngineScript{
            injectionPoint: WebEngineScript.DocumentReady
            name: "GazeCloudApi"
            sourceUrl: "/home/tylnesh/GazeCloudAPI.js"
            worldId: WebEngineScript.MainWorld
    
        }
    

    but I always get this error message:

    Can't open user script  QUrl("qrc:/home/tylnesh/GazeCloudAPI.js")
    
    1 Reply Last reply
    0
    • T Offline
      T Offline
      Tylnesh
      wrote on 10 Dec 2020, 11:57 last edited by
      #2

      17 views and no reply?

      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