With native context menus enabled you can't remove buttons from the toolbar
Categories
(Core :: Widget: Cocoa, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox89 | --- | verified |
People
(Reporter: soeren.hentzschel, Assigned: mstange)
References
Details
(Whiteboard: [proton-context-menus][mac:mr1])
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
STR:
- set widget.macos.native-context-menus to true
- try to remove a toolbar button via context menu
Expected:
The toolbar button is removed.
Actual:
Nothing happens. There is an error in the browser console:
TypeError: can't access property "ownerDocument", aNode is null (CustomizeMode.jsm:638:22)
It's the following line:
let areaNode = aNode.ownerDocument.getElementById(area);
in this code block:
_getCustomizableChildForNode(aNode) {
// NB: adjusted from _getCustomizableParent to keep that method fast
// (it's used during drags), and avoid multiple DOM loops
let areas = CustomizableUI.areas;
// Caching this length is important because otherwise we'll also iterate
// over items we add to the end from within the loop.
let numberOfAreas = areas.length;
for (let i = 0; i < numberOfAreas; i++) {
let area = areas[i];
let areaNode = aNode.ownerDocument.getElementById(area);
let customizationTarget = CustomizableUI.getCustomizationTarget(areaNode);
if (customizationTarget && customizationTarget != areaNode) {
areas.push(customizationTarget.id);
}
let overflowTarget = areaNode && areaNode.getAttribute("overflowtarget");
if (overflowTarget) {
areas.push(overflowTarget);
}
}
areas.push(kPaletteId);
while (aNode && aNode.parentNode) {
let parent = aNode.parentNode;
if (areas.includes(parent.id)) {
return aNode;
}
aNode = parent;
}
return null;
},
Assignee | ||
Comment 1•4 years ago
|
||
Thanks for filing!
This accesses document.popupNode during the menuitem command event: https://searchfox.org/mozilla-central/rev/bb37e6fe8bbe383a57a4ad21a201e26416613ca1/browser/components/customizableui/content/panelUI.inc.xhtml#58 / https://searchfox.org/mozilla-central/rev/bb37e6fe8bbe383a57a4ad21a201e26416613ca1/browser/base/content/browser.xhtml#455
Comment 2•4 years ago
|
||
Similar for the "Pin to overflow menu" item. Error:
NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDocShell.domWindow] 2 browsing-context.js:402
TypeError: can't access property "ownerDocument", aNode is null
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
I'm working on making document.popupNode
work as expected for native context menus.
Assignee | ||
Comment 4•4 years ago
|
||
Depends on D110303
Comment 7•4 years ago
|
||
bugherder |
Comment 8•4 years ago
|
||
Reproduce the issue mentioned in comment 0 using Firefox 89.0a1 (build from 2021-03-24).
This issue is verified fixed using Firefox 89.0a1 (BuildId:20210414160838) on macOS 10.15 with native menus enabled.
Description
•