RESOLVED FIXED 20385
REGRESSION (r35676): Firebug command line extensions interfere with existing objects
https://bugs.webkit.org/show_bug.cgi?id=20385
Summary REGRESSION (r35676): Firebug command line extensions interfere with existing ...
Brian Mitchell
Reported 2008-08-14 13:10:02 PDT
The web inspector's console allows evaluation of code within the context of the inspected document. In many cases these pages have a number of javascript functions setup using common names like $. The firebug compatible functions override these calls causing many expressions to fail to evaluate in cases where different behavior was provided in those names under those calls. I would propose that the script check for predefined values before overriding with its own. I would also encourage having some of this functionality available via an isolated module (maybe $inspector would be an appropriate name) so those who want access to both behaviors can use the adjusted name.
Attachments
quick fix (3.17 KB, patch)
2008-08-14 16:07 PDT, Keishi Hattori
no flags
the better one (1.69 KB, patch)
2008-08-14 16:48 PDT, Keishi Hattori
timothy: review+
Brian Mitchell
Comment 1 2008-08-14 13:34:14 PDT
I've checked firebug's behavior with this. Firebug does not override any of the pages functions if they exist with the same name. This allows the original functions to be used as expected.
Adam Roben (:aroben)
Comment 2 2008-08-14 13:41:58 PDT
Keishi Hattori
Comment 3 2008-08-14 16:07:49 PDT
Created attachment 22801 [details] quick fix
Timothy Hatcher
Comment 4 2008-08-14 16:13:18 PDT
A better fix might be a simple as: expression = "with (window._inspectorCommandLineAPI) { with (window) { " + expression + " } }"; The window object will be picked first, then _inspectorCommandLineAPI, then the global (window) object again.
Keishi Hattori
Comment 5 2008-08-14 16:22:41 PDT
(In reply to comment #4) > expression = "with (window._inspectorCommandLineAPI) { with (window) { > " + expression + " } }"; That's much better...
Timothy Hatcher
Comment 6 2008-08-14 16:24:53 PDT
(In reply to comment #5) > (In reply to comment #4) > > expression = "with (window._inspectorCommandLineAPI) { with (window) { > > " + expression + " } }"; > > That's much better... > Did it work? I have not tested it. You should make a test case to land with your change. Put it in WebCore/manual-tests/inspector
Keishi Hattori
Comment 7 2008-08-14 16:48:22 PDT
Created attachment 22802 [details] the better one It worked. I'm not sure if this is what you meant for a test case.
Timothy Hatcher
Comment 8 2008-08-14 16:50:05 PDT
Comment on attachment 22802 [details] the better one Yep, looks good!
Timothy Hatcher
Comment 9 2008-08-14 16:57:37 PDT
Landed in r35769.
Timothy Hatcher
Comment 10 2008-08-14 17:00:34 PDT
Thanks for the bug report Brian!
Note You need to log in before you can comment on or make changes to this bug.