PabloRomanH / zhongzhong

Chrome extension that translates Chinese words when hovering on them.
https://chrome.google.com/webstore/detail/zhongzhong-an-improved-ch/dggcgdjndddfmcfoipccicfoajmciacf
34 stars 14 forks source link

Doesn't seem to work on .txt files opened in chrome #53

Closed alexkassil closed 2 years ago

alexkassil commented 2 years ago

Hello! Love this and recently switched over from Zhongwen. When opening a .txt file in chrome, I cannot get ZhongZhong to work even though Zhongwen works.

I am not too familiar with javascript, but my best is guess is https://github.com/PabloRomanH/zhongzhong/blob/07c775706155d6a944365ea07586007c8c236b03/content.js#L919 here one could add something like ev.target.nodeName == 'PRE' since for a textfile opened it chrome it just becomes a big preformatted page of just text.

I was trying to build locally to fix myself, but got stuck in the step after running python index.py, unsure how to find what was unpacked and load it into chrome.

PabloRomanH commented 2 years ago

I've tried it out and it seems to be working fine. Both Zhongwen and Zhongzhong behave exactly the same. They work on TXT files that have been loaded from a URL. When opening local files, neither Zhongwen nor Zhongzhong work unless you go to Extensions -> Zhongzhong -> Details -> Allow access to file URLs.

Closing.