"Share" entry in tab context menu doesn't get its "id" attribute
Categories
(Firefox :: Untriaged, defect)
Tracking
()
People
(Reporter: vlakoff, Unassigned)
Details
Steps to reproduce:
I noticed the following issue when playing around to remove the "Share" entry in tab context menu, using "userChrome.css" customization.
let l10nID =
menu.id == "tabContextMenu"
? "tab-context-share-url"
: "menu-file-share-url";
document.l10n.setAttributes(shareURL, l10nID);
The 2nd argument (l10nID
) passed to setAttributes()
is a string, whereas it is expected to be a "name->value" object. Should probably be replaced with shareURL.setAttribute('id', l10nID)
.
Actual results:
"Share" entry in tab context menu doesn't have "id" attribute.
Expected results:
"Share" entry in tab context menu should have an "id" attribute, with value "tab-context-share-url".
On a related note, this "Share" entry can be more efficiently removed by using "about:config":
Create a new setting browser.menu.share_url.allow
, with value false
.
Mmmm… such "tab-context-..." values are not for "id" attributes, but for "data-lazy-l10n-id" attributes.
See https://searchfox.org/mozilla-central/source/browser/base/content/main-popupset.inc.xhtml
It seems that passing a string as 2nd argument to document.l10n.setAttributes()
is fine, although I didn't find the method definition.
Search for "setAttributes": https://searchfox.org/mozilla-central/search?q=symbol:%23setAttributes&redirect=false
I didn't understand the rationale of these "localized IDs", but I don't care much about this.
So, the code should be fine actually. And I'm happily using the available "about:config" setting.
(I figured out what these "data-lazy-l10n-id" are for. It's a mechanism for lazy-localizing elements.)
Description
•