Bug 46566

Summary: [Qt] Add QWebFrame::addToJavaScriptWindowProperty()
Product: WebKit Reporter: Robert Hogan <robert>
Component: WebKit QtAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: benjamin, daniel.nystrom, hausmann, kling
Priority: P2 Keywords: Qt, QtTriaged
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 41801    
Attachments:
Description Flags
Patch
none
Patch none

Robert Hogan
Reported 2010-09-25 05:43:29 PDT
Add or override properties in the DOM Window object. This is necessary for clients that want to control the values returned by window.innerHeight, window.name and so on. Clients will want to do this to defeat some of the attacks outlined in https://bugs.webkit.org/show_bug.cgi?id=41801.
Attachments
Patch (4.94 KB, patch)
2010-09-25 05:47 PDT, Robert Hogan
no flags
Patch (5.99 KB, patch)
2010-09-29 11:04 PDT, Robert Hogan
no flags
Robert Hogan
Comment 1 2010-09-25 05:47:51 PDT
Robert Hogan
Comment 2 2010-09-26 07:37:27 PDT
It would be even nicer if we could 'put' a function or method rather than a value in the window property. However I can't see how this would be possible. So if anyone has suggestions please weigh in!
Simon Hausmann
Comment 3 2010-09-29 00:09:49 PDT
Hmm, why not simply overload addToJavascriptWindowObject? :) The Object suffix in them method name refers to the window object, not to adding an object to the window.
Simon Hausmann
Comment 4 2010-09-29 00:11:57 PDT
In the medium term a move to V8 would make all this obsolete though, because then we can have QScriptEngine* QWebFrame::scriptEngine() and you can do everything you could ever imagine (with JavaScript :)
Robert Hogan
Comment 5 2010-09-29 11:04:38 PDT
Robert Hogan
Comment 6 2010-09-29 11:18:23 PDT
(In reply to comment #4) > In the medium term a move to V8 would make all this obsolete though, because then we can have QScriptEngine* QWebFrame::scriptEngine() and you can do everything you could ever imagine (with JavaScript :) I've updated it per your previous comment anyway - so ball in your court! QWebFrame::scriptEngine() sounds great though - can't wait! Am I missing a trick or is there a way of overriding the DOM Window's object properties with the properties of a QObject? I can't see it - hence the current patch to just set the values.
Robert Hogan
Comment 7 2010-12-12 10:47:30 PST
Any thoughts on this? Will it be accepted?
Benjamin Poulain
Comment 8 2011-01-30 09:17:43 PST
I am with Simon on this, I think we should not add more stuff to QWebFrame that are really related to the Script Engine. I think it is better to focus on exposing QtScript.
Jocelyn Turcotte
Comment 9 2014-02-03 03:16:46 PST
=== Bulk closing of Qt bugs === If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it and remove [Qt] from the summary. If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines.
Note You need to log in before you can comment on or make changes to this bug.