Bug 1411011 - stop offering context menu (re)move options on skipintoolbarset items, r?jaws
Giving all these nodes ids doesn't seem like the right fix. `buildArea` already ignores skipintoolbarset
items before doing anything else with nodes, so bailing out early seemed like the right solution here.
MozReview-Commit-ID: H3EyqoospNR
--- a/browser/components/customizableui/CustomizableUI.jsm
+++ b/browser/components/customizableui/CustomizableUI.jsm
@@ -2764,16 +2764,20 @@ var CustomizableUIInternal = {
* @return {Boolean} whether the widget is removable
*/
isWidgetRemovable(aWidget) {
let widgetId;
let widgetNode;
if (typeof aWidget == "string") {
widgetId = aWidget;
} else {
+ // Skipped items could just not have ids.
+ if (!aWidget.id && aWidget.getAttribute("skipintoolbarset") == "true") {
+ return false;
+ }
if (!aWidget.id &&
!["toolbarspring", "toolbarspacer", "toolbarseparator"].includes(aWidget.nodeName)) {
throw new Error("No nodes without ids that aren't special widgets should ever come into contact with CUI");
}
// Use "spring" / "spacer" / "separator" for special widgets without ids
widgetId = aWidget.id || aWidget.nodeName.substring(7 /* "toolbar".length */);
widgetNode = aWidget;
}