Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linkText property to extension chrome.contextMenus.OnClickData #124

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions chrome/browser/extensions/menu_manager.cc
Expand Up @@ -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);

Expand Down
5 changes: 5 additions & 0 deletions chrome/common/extensions/api/context_menus.json
Expand Up @@ -75,6 +75,11 @@
"optional": true,
"description": " The <a href='webNavigation#frame_ids'>ID of the frame</a> 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,
Expand Down