This exposes additional options to inspectedWindow.eval() and SidebarPane.setExpression() that allow extensions to specify that evaluation should be performed in the context of the content script of those extensions.
Created attachment 141700 [details] Patch
Comment on attachment 141700 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=141700&action=review > Source/WebCore/inspector/front-end/ExtensionAPI.js:419 > + var callback = extractCallbackArgument(arguments); Can we avoid this and have callback at a fixed position? Probably do it by passing an arguments map as the firs parameter instead of expression string as you suggested? > Source/WebCore/inspector/front-end/ExtensionServer.js:729 > + * @param {Object} options Please keep parameter annotations in the same order as the parameters. > Source/WebCore/inspector/front-end/JavaScriptContextManager.js:208 > + function comparator(securityOrigin, context) I'd rather use a linear search here. > Source/WebCore/inspector/front-end/JavaScriptContextManager.js:216 > + return this._isolatedContexts[index]; Pleas add explicit return statement for the case when there is no context matching that security origin.
Comment on attachment 141700 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=141700&action=review >> Source/WebCore/inspector/front-end/ExtensionAPI.js:419 >> + var callback = extractCallbackArgument(arguments); > > Can we avoid this and have callback at a fixed position? Probably do it by passing an arguments map as the firs parameter instead of expression string as you suggested? As discussed offline -- we'd like expression to appear on its own as it's a mandatory parameter. >> Source/WebCore/inspector/front-end/ExtensionServer.js:729 >> + * @param {Object} options > > Please keep parameter annotations in the same order as the parameters. Fixed! >> Source/WebCore/inspector/front-end/JavaScriptContextManager.js:208 >> + function comparator(securityOrigin, context) > > I'd rather use a linear search here. Done! >> Source/WebCore/inspector/front-end/JavaScriptContextManager.js:216 >> + return this._isolatedContexts[index]; > > Pleas add explicit return statement for the case when there is no context matching that security origin. Done.
Committed r116957: <http://trac.webkit.org/changeset/116957>