Using '%s' in the contextmenu title field returns '...' extra

RESOLVED DUPLICATE of bug 1370228

Status

defect
RESOLVED DUPLICATE of bug 1370228
2 years ago
10 months ago

People

(Reporter: ss_jimmy, Unassigned)

Tracking

56 Branch

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0
Build ID: 20170722030204

Steps to reproduce:

Create a new WebExtension (to add an option to a selection context menu), and use '%s' in the title field to quote the user's selected text.

background.js:
browser.contextMenus.create({
  id: "log-selection",
  title: "Log '%s' to the console",
  contexts: ["selection"]
});

browser.contextMenus.onClicked.addListener(function(info, tab) {
  if (info.menuItemId == "log-selection") {
    console.log(info.selectionText);
  }
});

Load into Firefox, mark text and rightclick.


Actual results:

For example, if I mark:
abcdefg

I would get:
Log 'abcdefg...' to the console


Expected results:

The marked text should be replicated exactly by using %s in the title, without adding '...' at the end:
Log 'abcdefg' to the console 

As stated here:
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/contextMenus/create
Component: Untriaged → WebExtensions: Frontend
Product: Firefox → Toolkit

Comment 1

2 years ago
Shane to possibly dupe.
Flags: needinfo?(mixedpuppy)
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
Flags: needinfo?(mixedpuppy)
Resolution: --- → DUPLICATE
Duplicate of bug: 1370228

Updated

10 months ago
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.