Reputation: 972
I'm trying to add a sidebar (experimental) to my extension.
I've enabled the "Experimental Extension APIs" in Chrome.
When I invoke:
chrome.experimental.sidebar.show(cTab);
method, (where cTab is current tab) I get an error:
Error during experimental.sidebar.show: This extension has no sidebar specified.
When I invoke:
chrome.experimental.sidebar.getState(cTab, function (state) { alert(state); });
I get "undefined" in the alert box.
I read the specs of chrome.experimental.sidebar and I have no clue how to add a sidebar to Chrome.
How can I specify a sidebar for my extension? Please help.
Upvotes: 4
Views: 2310
Reputation: 2321
This is no longer supported unfortunately. See:
How to create a sidebar(right-side) in google chrome?
Chrome.experimental.sidebar gone?
http://code.google.com/p/chromium/issues/detail?id=51084
Hopefully they'll add it back new and improved in a future release.
You'll need to use the DOM injection approach.
Upvotes: 2
Reputation: 111325
First declare sidebar
in your manifest:
{
...
"sidebar": {},
...
}
Then to display sidebar.html
in a current tab:
chrome.experimental.sidebar.show();
chrome.experimental.sidebar.expand();
chrome.experimental.sidebar.navigate({path: "sidebar.html"});
Here is example extension.
Upvotes: 4