otzbergnet/wbmExtension

[Bug] wrong link opened through context menu

gingerbeardman opened this issue · 3 comments

When I right click a link, it is this that the Context Menu should open.

Currently it opens the page I am on.

Here I want to open the highlighted link:

Screen shot 2019-11-18 at 14 04 32

Ref:
https://forest.watch.impress.co.jp/article/2003/03/10/kacyouhuugetsu.html

There is JavaScript code in my original extension that will get the HREF of an element if the context menu was opened on one.

Alright, that makes a ton of sense. I need to look into how to implement it, but surely it must be possible :)

took me forever to find it, but this is the magic javascript I needed:

window.getSelection().anchorNode.parentNode.href

Anyhow, I implemented this and it should (crossing fingers) resolve this one. It is so obvious when you said it, but I hadn't understood it this way