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
New Variable: Access to right-clicked link text #94
Comments
I think I may have found a possible workaround for this limitation. If I add something like the following to the context listener; rightClicked = null
window.oncontextmenu = (e) ->
rightClicked = e.target unless e.target instanceof HTMLDocument Now, whenever a Template is activated through the context menu that originated from a link, the contents of This process may also make #95 possible as a reference to the last right-clicked input field should be available, which would allow a follow up request to change the value of this field to the rendered output. It might be better if |
I think this is the best way of recording right-clicks. rightClicked = {}
window.addEventListener 'contextmenu', (e) ->
switch e.target.nodeName
# Record link (for link text access)
when 'A' then rightClicked.link = e.target
# Record field (for auto-paste functionality)
when 'INPUT', 'TEXTAREA' then rightClicked.field = e.target I'll still need to work out how/when's best to send this data to the background page. I'm confident this is now possible though. |
This is working great in development. I'll hopefully be including this in a release aimed at this weekend. I've added the following standard variables;
However, on reflection, these may appear confusing as they are not actually links so I'm considering changing these to something like |
I've renamed link to linkText and I'm now happy enough to include this change in this weekend's update. |
Ticket 5 from uservoice:
My reply:
As mentioned in my reply, I will not be able to do anything for this for now as the information is just not easily available. I'm considering raising a feature request with Chromium to add this as it would clearly be extremely useful to extension developers.
The text was updated successfully, but these errors were encountered: