Bug 1338727 add command support for sidebar-action, r=aswan
MozReview-Commit-ID: Jp1cuTzsDz4
This commit is contained in:
@@ -125,16 +125,22 @@ CommandList.prototype = {
|
||||
// We remove all references to the key elements when the extension is shutdown,
|
||||
// therefore the listeners for these elements will be garbage collected.
|
||||
keyElement.addEventListener("command", (event) => {
|
||||
let action;
|
||||
if (name == "_execute_page_action") {
|
||||
let win = event.target.ownerGlobal;
|
||||
pageActionFor(this.extension).triggerAction(win);
|
||||
action = pageActionFor(this.extension);
|
||||
} else if (name == "_execute_browser_action") {
|
||||
let win = event.target.ownerGlobal;
|
||||
browserActionFor(this.extension).triggerAction(win);
|
||||
action = browserActionFor(this.extension);
|
||||
} else if (name == "_execute_sidebar_action") {
|
||||
action = sidebarActionFor(this.extension);
|
||||
} else {
|
||||
this.extension.tabManager
|
||||
.addActiveTabPermission();
|
||||
this.emit("command", name);
|
||||
return;
|
||||
}
|
||||
if (action) {
|
||||
let win = event.target.ownerGlobal;
|
||||
action.triggerAction(win);
|
||||
}
|
||||
});
|
||||
/* eslint-enable mozilla/balanced-listeners */
|
||||
|
||||
Reference in New Issue
Block a user