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. Enabling and Disabling JavaScript alerts

Enabling and Disabling JavaScript alerts

Scheduled Pinned Locked Moved Qt WebKit
2 Posts 2 Posters 4.2k 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.
  • W Offline
    W Offline
    Wonderkid
    wrote on 3 Mar 2011, 18:49 last edited by
    #1

    HI,
    I wanted to to enable and disable javaScript alerts. I need to keep the JavaScript enabled. I only want to turn Off this alert feature. I found out that the way to achieve this was to subclass QWebPage and reimplement javaScriptAlert function.

    "Reference":http://doc.qt.nokia.com/4.7-snapshot/qwebpage.html#javaScriptAlert

    Is there any other way to do this? Because I need to restructure my code if I want to subclass QWebPage. I didn't know it at the development time and when I wanted to disable javaScript alert I found this way.

    I also tried the following
    I knew which function caused javaScript alerts so before entering that function I disabled Javascript using (QWebSettings::setAttribute()) and re-enabled javaScript after exiting the function. But that didn't work.

    Thanx in advance :)

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rich
      wrote on 5 Mar 2011, 14:24 last edited by
      #2

      Reimplementing the javaScriptAlert/confirm etc. functions is the way to do it. There isn't really another one.

      1 Reply Last reply
      0

      2/2

      5 Mar 2011, 14:24

      • Login

      • Login or register to search.
      2 out of 2
      • First post
        2/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved