Dictionary-Anywhere icon indicating copy to clipboard operation
Dictionary-Anywhere copied to clipboard

Doesn't work in the www.zerohedge.com comments section

Open nadesco opened this issue 4 years ago • 11 comments

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 avatar Dec 05 '19 02:12 nadesco

@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.

meetDeveloper avatar Dec 05 '19 15:12 meetDeveloper

I have to look more into it, I tried capturing event even that does not work, somehow.

meetDeveloper avatar Dec 05 '19 15:12 meetDeveloper

@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 avatar Mar 26 '20 09:03 chriscz

@chriscz How would I know that person has clicked somewhere if that event is not bubbled up?

meetDeveloper avatar Jun 17 '20 10:06 meetDeveloper

@chriscz Sorry for delay in reply, life got me busy these months.

meetDeveloper avatar Jun 17 '20 10:06 meetDeveloper

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!

chriscz avatar Jun 17 '20 12:06 chriscz

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!.

gomain avatar Aug 31 '20 05:08 gomain

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

meetDeveloper avatar Dec 07 '20 17:12 meetDeveloper

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 avatar Dec 08 '20 06:12 nadesco

@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.

meetDeveloper avatar Dec 08 '20 06:12 meetDeveloper

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

SethFalco avatar Mar 09 '23 16:03 SethFalco