[Webkit-unassigned] [Bug 106811] Web Inspector: Add iframe option to inspectedWindow.eval() extension API
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Jan 30 08:47:29 PST 2013
https://bugs.webkit.org/show_bug.cgi?id=106811
--- Comment #19 from johnjbarton <johnjbarton at chromium.org> 2013-01-30 08:49:27 PST ---
(In reply to comment #18)
> (From update of attachment 185286 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=185286&action=review
>
> > Source/WebCore/inspector/front-end/ExtensionServer.js:348
> > + var status = this.evaluate(message.expression, true, true, message.evaluateOptions, port._extensionOrigin, callback.bind(this));
> > + if (status) {
> > + callback.call(this, "Extension server error: " + String.vsprintf(status.description, status.details));
> > + }
>
> I still think this should not be necessary: the convention is that if the error condition is immediately detect by a handler, the handler returns the error and then ExtensionServer::_onmessage will dispatch the error to the client callback.
But without this change the handler never sees the error condition! If evaluate() returns say, E_NOTFOUND, and we ignore the return value (as without this patch) how can _onMessage dispatch an error to the client? It does not even see the error.
Maybe you prefer a different solution, but I could not get my code to work without some change here.
>
> > Source/WebCore/inspector/front-end/ExtensionServer.js:795
> > + WebInspector.resourceTreeModel.forAllFrames(function(frame) {
>
> Can we just resturn frames array from ResourceTreeModel. I think it would require fewer callbacks and make code more readable.
Because _frames in ResourceTreeModel is not an array, it's a map from frame.id -> frame. We can create an array if you prefer. I was just trying to follow the practice in that file.
...
> > LayoutTests/http/tests/inspector/extensions-eval.html:75
> > + var segments = url.split('/'); // http://a.b.c:xxx/path
> > + var origin = segments[0] + '//' + segments[2];
>
> I think just hard-coding it would make it more readable.
What value should I use then?
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list