Reputation: 7736
When I selected some text, the context menu title is updated. For instance:
Is it possible to do this as an extension developer?
My current code:
chrome.contextMenus.create({
"title":"I WANT THIS UPDATED",
"contexts":["browser_action"],
"onclick":function(info, tab) {
chrome.tabs.create({url: 'https://www.facebook.com/'});
}
});
Thanks,
Upvotes: 0
Views: 674
Reputation: 77521
Yes, it's possible, but not for browser_action
context.
The screenshot you're showing is for selection
context.
Quoting the documentation:
When the context is
'selection'
, you can use%s
within the string to show the selected text. For example, if this parameter's value is "Translate '%s' to Pig Latin" and the user selects the word "cool", the context menu item for the selection is "Translate 'cool' to Pig Latin".
See this answer for more info on context types.
Upvotes: 1