summaryrefslogtreecommitdiff
blob: b5a9b01bf140c6009632f15847c574acf944feeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
@@ -317,4 +317,6 @@
     javaScriptWindowObjectCleared() signal.
 
+    If Javascript is not enabled for this page, then this method does nothing.
+
     The \a object will never be explicitly deleted by QtWebKit.
 */
@@ -339,8 +341,13 @@
     javaScriptWindowObjectCleared() signal.
 
+    If Javascript is not enabled for this page, then this method does nothing.
+
     The ownership of \a object is specified using \a own.
 */
 void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object, QScriptEngine::ValueOwnership ownership)
 {
+    if (!page()->settings()->testAttribute(QWebSettings::JavascriptEnabled))
+        return;
+
     JSC::JSLock lock(false);
     JSDOMWindow* window = toJSDOMWindow(d->frame);