Created attachment 43867 [details] Patch This feature is useful for clients that want to manage and even conceal the information that is revealed by javascript. Add a testcase to ensure this behaviour is preserved.
This seems like it could be a bad API to expose long-term. I worry this could come back to bite Qt-WebKit like the history API did.
Attachment 43867 [details] did not pass style-queue: Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1 WebKit/qt/tests/qwebframe/tst_qwebframe.cpp:517: This { should be at the end of the previous line [whitespace/braces] [4] WebKit/qt/tests/qwebframe/tst_qwebframe.cpp:525: Place brace on its own line for function definitions. [whitespace/braces] [4] WebKit/qt/tests/qwebframe/tst_qwebframe.cpp:528: Place brace on its own line for function definitions. [whitespace/braces] [4] WebKit/qt/tests/qwebframe/tst_qwebframe.cpp:531: Place brace on its own line for function definitions. [whitespace/braces] [4] WebKit/qt/tests/qwebframe/tst_qwebframe.cpp:1993: More than one command on the same line [whitespace/newline] [4] Done processing WebKit/qt/tests/qwebframe/tst_qwebframe.cpp Total errors found: 5
The window.navigator object is explicitly marked as "[Replaceable]". The behaviour of addToJavaScriptWindowObject() being able to replace replaceable objects is sensible. I think it would be best to make a simple and explicit test for that (doesn't have to use the navigator example). I would not rely on it being possible though to replace non-deletable properties in the window object.
Comment on attachment 43867 [details] Patch As discussed on IRC, it would be better to change this test to simply verify that addToJAvaScriptWindowOBject can replace an replaceable object. The navigator part is almost overkill :) + Need a short description and bug URL (OOPS!) This line shouldn't be there :)
(In reply to comment #4) > (From update of attachment 43867 [details]) > As discussed on IRC, it would be better to change this test to simply verify > that addToJAvaScriptWindowOBject can replace an replaceable object. The > navigator part is almost overkill :) Agreed (except for the "almost" part ;) ).
(In reply to comment #3) > The window.navigator object is explicitly marked as "[Replaceable]". The behaviour of addToJavaScriptWindowObject() being able to replace replaceable objects is sensible. I think it would be best to make a simple and explicit test for that (doesn't have to use the navigator example). > > I would not rely on it being possible though to replace non-deletable properties in the window object. Hi Simon, So how could I go about replacing the properties of read-only objects such as the Screen object? Where could I start to look for a way of doing this?
Resolved by https://bugs.webkit.org/show_bug.cgi?id=41802
Moving all JavaScriptGlue bugs to JavaScriptCore. The JavaScriptGlue framework itself is long gone. And most of the more recent bugs put in this component were put there by people who thought this was for some other aspect of “JavaScript glue” and have nothing to do with the actual original reason for the existence of this component, which was an OS-X-only framework named JavaScriptGlue.