Dictionary-Anywhere
Dictionary-Anywhere copied to clipboard
Doesn't work in the www.zerohedge.com comments section
Great little addon but it doesn't work properly on this site: www.zerohedge.com . The pop-up window appears when any word is double clicked within the article itself but it doesn't show in the comments section for some reason.
@nadesco I did a preliminary analysis, it looks like they stop the click event to bubble up, and so my extension is unable to capture that some click happened, and so is not showing any meaning.
I have to look more into it, I tried capturing event even that does not work, somehow.
@meetDeveloper I recall once having a similar issue in a web-app and I opted for a solution that finds the element at the coordinates under the cursor click. This may not be an efficient solution if it's the primary one, however if you use it as fallback (i.e. no event after 20ms of clicking) it may work.
@chriscz How would I know that person has clicked somewhere if that event is not bubbled up?
@chriscz Sorry for delay in reply, life got me busy these months.
No problem. That's how it goes! :sweat_smile: From what I recall you could either add an overlay or catch the mouseup event. These two SO Q's have some interesting approaches to bypassing or catching those:
- https://stackoverflow.com/questions/11533098/how-to-catch-mouse-up-event-outside-of-element
- https://stackoverflow.com/questions/8054429/how-do-i-handle-a-click-anywhere-in-the-page-even-when-a-certain-element-stops
If you did this and you discover the coordinates you can find the element at that coordinate
- https://stackoverflow.com/questions/1259585/get-element-at-specified-position-javascript
I hope it helps!
Also not working in leanpub.com read-online.
Go to https://leanpub.com/manual/read_full then follow the links to buy the book. Do buy the book (at $0.00) — there is no bug in the Free to Read Online option!.
So found the issue, the comment section of zerohedge is in an iframe and my javasript runs in context of the page and so it does not catch click events that are done in the iframe. @chriscz @gomain
Thanks for looking into that. It still doesn't work in the comments section unfortunately. I have uBlock Origin, NoScript (frames enabled) and Little Snitch installed and thought that a setting in one of those might have stopped the add-on from working properly, so I disabled all of them and tried again. There was no change but if it works on your machine then it might be a different setting or app that's causing the popup window not to show on mine. The add-on still works as it should within the article. Version 1.0.10
@nadesco I have not fixed this issue yet. 😅 I just found out the what is causing the issue. Need to spend some time thinking about solution.
Having the same issue as this. Perhaps the issue title should be renamed to refer to the actual problem?
Meanwhile, learning a course on edX and unfortunate I this extension doesn't return definitions of terms used in course material because it's in an iframe. :c