cschiller / zhongwen

Official source code of the "Zhongwen" Chrome extension
https://chrome.google.com/webstore/detail/zhongwen-chinese-english/kkmlkkjojmombglmlpbpapmhcaljjkde
GNU General Public License v2.0
322 stars 53 forks source link

Nothing pops up when hovering over comments on bilibili #122

Open laovvai opened 2 weeks ago

laovvai commented 2 weeks ago

Hey, first of all thank you for creating such a awesome tool for language learners, I'm using it on a daily basis for sentence mining.

I've run into some issues, the extension doesn't seem to work for comments on bilibili. I can look up words in titles or video descriptions but when I try to hover over comments, there is nothing popping up. There might some layers that prevent Zhongwen from parsing the characters. I've tried using Yomitan on the comment section and it worked, so I guess there must be a workaround for this problem.

Thank you in advance!

cschiller commented 2 weeks ago

I tried Yomitan and for me it doesn't work in the comment section either. It looks like bilibili is using some JavaScript which breaks Zhongwen (and Yomitan).

chinese-words-separator commented 2 weeks ago

It works with Zhongwen

https://www.bilibili.tv/en/play/35336

image

What's the URL that is not working?

cschiller commented 2 weeks ago

I think it works for comments on bilibili.tv (the international site), but not for comments on bilibili.com (the Chinese site).

chinese-words-separator commented 2 weeks ago

Hmm.. it does not work on bilibili.com

Just as expected, it's wrapped in Shadow DOM, hence extensions won't be able to work on it. What's surprising is why the Chinese site need to use that tech while the international site don't

image

Extensions can't see the content of Shadow DOM, and canvas too

laovvai commented 2 weeks ago

Okay, thank everyone for their input! Yes, I was trying to read comments on the chinese version of b站 and somehow I was sure Yomitan worked for me in the past but I can't replicate the results now. I don't really understand why they would wrap the comment section in Shadow DOM. It's still possible to copy paste the text from bilibili, so it doesn't really protect the information users leave on the page.