[Webkit-unassigned] [Bug 106811] Web Inspector: Add iframe option to inspectedWindow.eval() extension API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 17 07:09:27 PST 2013


https://bugs.webkit.org/show_bug.cgi?id=106811





--- Comment #11 from Andrey Kosyakov <caseq at chromium.org>  2013-01-17 07:11:13 PST ---

> 
> Devtools extensions are not peers of browser extensions: they are explicitly -- by the specific user opening devtools -- granted extra power -- eg the ability to eval() directly into the context of web page. Shouldn't devtools extensions should be able to eval() into browser extensions just like devtools can?
> 

Well, we did not enable this originally, but this was perhaps just overcautiousness. I discussed this again with Pavel, and the consensus was -- let's do it!

> > 
> > I think E_NOTFOUND is more appropriate here, E_FAILED is too generic.
> 
> Actually the opposite was my experience: I started with E_NOTFOUND but I could not figure out what to do with an error message like 'Not found "http://localhost:9696"'. I realize that E_NOTFOUND makes better documentation in the source code but the resulting error message is not as good for the extension author.

My primary design goal for error reporting was making the errors easy to process programmatically and (at least in theory) possible to localize. So aside from a the last resort, catch-all E_FAILED that allows arbitrary text, other errors don't expect user-friendly text as parameters. So I'd suggest the following options:
- return E_NOTFOUND for frame if you did not find frame, E_NOTFOUND for context if you did not find context within the frame; optionally, add a console.warn() if you feel extension authors may be confused;
- introduce specific error code for the situation, along with verbose error message;

-- 
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