Skip to content

Commit

Permalink
Cherry pick Legacy Toolbar Button support #1321 (part 3)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVallat committed May 30, 2015
1 parent 3558149 commit e9633d4
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions platform/firefox/vapi-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -2087,11 +2087,18 @@ vAPI.contextMenu.register = function(doc) {
return;
}

if (doc.getElementById(this.menuItemId)) {
// Context menu already registered for this window
return;
}

var contextMenu = doc.getElementById('contentAreaContextMenu');
var menuitem = this.createContextMenuItem(doc);
menuitem.addEventListener('command', this.onCommand);
contextMenu.addEventListener('popupshowing', this.displayMenuItem);
contextMenu.insertBefore(menuitem, doc.getElementById('inspect-separator'));
if (contextMenu) {
var menuitem = this.createContextMenuItem(doc);
menuitem.addEventListener('command', this.onCommand);
contextMenu.addEventListener('popupshowing', this.displayMenuItem);
contextMenu.insertBefore(menuitem, doc.getElementById('inspect-separator'));
}
};

/******************************************************************************/
Expand Down

0 comments on commit e9633d4

Please sign in to comment.