chrome.devtools.panels.create is documented to receive only one parameter:
https://developer.chrome.com/extensions/devtools_panels#method-create
https://chromium.googlesource.com/chromium/src/+/082850a5cb3946bb595bb6aca588a1c227d2a66e/chrome/common/extensions/api/devtools/panels.json#329
However, it receives two parameters:
// From a devtools extension:
chrome.devtools.panels.create('manifest.json', '', '', function(...args){console.log(JSON.stringify(args, null, 4))});
// result:
[
{
"onShown": {},
"onHidden": {},
"onSearch": {}
},
{
"code": "OK",
"description": "OK",
"details": []
}
]
// The object with onShown,onHidden,onSearch is expected, the object with code,description,details is not expected and leaks an internal implementation detail.
This is caused by https://chromium.googlesource.com/chromium/src/+/082850a5cb3946bb595bb6aca588a1c227d2a66e/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAPI.js#256
extensionServer.sendRequest(request, callback && callback.bind(this, new ExtensionPanel(id)));
should be
extensionServer.sendRequest(request, callback && () => { callback.call(this, new ExtensionPanel(id)); });
or, if you don't care about "this" (which is identical to chrome.devtools.panels, but not documented to have that value):
extensionServer.sendRequest(request, callback && () => { callback(new ExtensionPanel(id)); });
Comment 1 by lazyboy@chromium.org
, Sep 29 2017Status: Assigned (was: Untriaged)