create method
Creates an extension panel.
title Title that is displayed next to the extension icon in the
Developer Tools toolbar.
iconPath Path of the panel's icon relative to the extension directory.
pagePath Path of the panel's HTML page relative to the extension
directory.
returns A function that is called when the panel is created.
Implementation
Future<ExtensionPanel> create(
String title,
String iconPath,
String pagePath,
) {
var $completer = Completer<ExtensionPanel>();
$js.chrome.devtools.panels.create(
title,
iconPath,
pagePath,
($js.ExtensionPanel panel) {
if (checkRuntimeLastError($completer)) {
$completer.complete(ExtensionPanel.fromJS(panel));
}
}.toJS,
);
return $completer.future;
}