diff --git a/chrome/browser/extensions/menu_manager.cc b/chrome/browser/extensions/menu_manager.cc index 43b630669e5b3..531112766d3d1 100644 --- a/chrome/browser/extensions/menu_manager.cc +++ b/chrome/browser/extensions/menu_manager.cc @@ -678,6 +678,8 @@ void MenuManager::ExecuteCommand(content::BrowserContext* context, AddURLProperty(properties, "pageUrl", params.page_url); AddURLProperty(properties, "frameUrl", params.frame_url); + if (params.link_text.length() > 0) + properties.SetStringKey("linkText", params.link_text); if (params.selection_text.length() > 0) properties.SetStringKey("selectionText", params.selection_text); diff --git a/chrome/common/extensions/api/context_menus.json b/chrome/common/extensions/api/context_menus.json index b45e77c367343..441cc8df5791c 100644 --- a/chrome/common/extensions/api/context_menus.json +++ b/chrome/common/extensions/api/context_menus.json @@ -75,6 +75,11 @@ "optional": true, "description": " The ID of the frame of the element where the context menu was clicked, if it was in a frame." }, + "linkText": { + "type": "string", + "optional": true, + "description": "If the element is a link, the text for the link. May be an empty string if the contents of the link are an image." + }, "selectionText": { "type": "string", "optional": true,