Pre/Post FF 63 How to Handle Access Keys in Context Menus

According to the docs on menus.create, the use of the ampersand (&) to create an access keys has only been implemented in FF 63 and later.

So, if I create a menu like with a title like this:

Plaster of &Paris Bagel and Cream Cheese Paperweight

In FF 63 and later, it will appear as:

Plaster of Paris Bagel and Cream Cheese Paperweight

And hitting the “P” key will activate that menu.

But in earlier versions, (FF ESR) it will appear as:

Plaster of &Paris Bagel and Cream Cheese Paperweight

What is the preferred solution to handle this display issue? (Obviously, I cannot implement the functionality pre 63)

For Firefox:

await browser.runtime.getBrowserInfo().then(info => parseInt(info.version)) >= 63 ? 'text with &' : 'text without &'

OK, thanks.

Since I only want to do this once, and not for each menu, I would make a variable, and incorporate it into the menu as needed.

Also, is there a permission that I need to add to the manifest to use getBrowserInfo()?

Nope, it would be mentioned in the docs. But right now it’s for Firefox only - if you would like check Chrome version, you would have to parse the userAgent string.