New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 766074 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

Feature request: Please add info.linkText property to context menu click callback

Reported by hnaka...@gmail.com, Sep 18 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.91 Safari/537.36

Steps to reproduce the problem:
1. Create a chrome extension which creates a context menu.
2. Move a mouse cursor over a link and select the context menu for the extension.

What is the expected behavior?
I expect there is a way to get the link text.

I expect the info object parameters in onClicked callback has the linkText property whose value is the text of the selected link.
https://developer.chrome.com/extensions/contextMenus#event-onClicked

What went wrong?
Currently the info object parameters in onClicked callback does not provide a way to get the text of the selected link.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 61.0.3163.91  Channel: stable
OS Version: 10.0
Flash Version: 

I create a extension to format the URL and the link text to the clipboard.

https://chrome.google.com/webstore/detail/format-link/pocemhmkmchpgamlnocemnbhlcjcbjgg?hl=ja
source: https://github.com/hnakamur/FormatLink-Chrome

As a workaround, I search a link of the same URL, and use the text of the first link found.
https://github.com/hnakamur/FormatLink-Chrome/blob/d8e69f6df205642412684bf9b97e344f63b97ea8/background.js#L20-L35

However if there are multiple links of the same URL in the page, the first link may be different from the selected link.

FYI, Firefox webextension API does have the linkText property in the info object.
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/menus/OnClickData
 
Cc: ranjitkan@chromium.org
Components: Platform>Extensions
Status: Untriaged (was: Unconfirmed)
Untriaged it so that it gets addressed.
Cc: rdevlin....@chromium.org
Labels: -Pri-2 Pri-3
Owner: catmulli...@chromium.org
Status: Assigned (was: Untriaged)
This seems pretty reasonable.  catmullings@ has been making changes in the contextMenus api lately.
Owner: ----

Sign in to add a comment