Saturday, February 19, 2022

Zhongwen

Zhongwen is an add-on for Chrome and Firefox that looks up Chinese characters. I use it on Firefox.

I was using Calibre to view e-books but then I wanted to view them in a browser so I could use the Zhongwen add-on to look up the characters I don't know.

I installed Calibre-Web and began studying some of my Chinese books that were in pdf format. It worked great. I could read along and easily look up the characters I didn't know.

But then I tried reading a Chinese book in epub format and I couldn't look up the characters. The Zhongwen add-on wasn't working, except on the title line at the top of the page.

It turns out that the Zhongwen add-on doesn't work on content in an iframe and Calibre-Web presents the contents of epub books in an iframe.

I developed an enhancement of Zhongwen (see the issue85 branch) that works on content in iframes. I have only tried it with Calibre-Web but it works fine there. With this, I can view epub books via Calibre-Web and look up the Chinese characters I don't know with the modified Zhongwen add-on.

The only remaining problem is that Firefox no longer lets me install a plugin that isn't signed by Mozilla, unless I use an unbranded release. Security is good and it would be good if requiring signed add-ons was default, but removing all possibility of installing my own add-ons is going too far. Not every Firefox user is incompetent to create their own add-on and manage add-ons safely. If someone has access to my system to manipulate my add-ons, they can just replace the Firefox executable. Requiring signed add-ons is a limitation without benefit.

It is possible to install an unsigned add-on temporarily from about:debugging. But then the add-on must be re-installed every time Firefox is restarted.  

I installed an unbranded nightly build of Firefox but still there are hoops to jump in order to install the add-on permanently. It works fine installed temporarily but there is no easy to find and follow documentation about how to install a locally developed add-on permanently, only very lengthy procedures about how to register with Mozilla and publish an add-on, which is a very involved and time consuming process to learn and exercise.

So, at the moment I am stuck with loading the add-on temporarily. It seems that Mozilla, despite a good start, has decided that making the life of users difficult and less productive is the way to go.

I have submitted a pull request to Zhongwen but thus far there has been no response from the author. Who knows when or if an update of the add-on will allow it to work on content in an iframe. I will try to be patient. I have something that works well enough for my study in the meantime, though it is a nuisance having to use a different browser.

If the add-on isn't enhanced for too long, I will consider releasing my own version, but that requires getting involved with Mozilla's publishing process, which I would rather not do. It is really unfortunate that I can't put something up on GitHub or the like that people can download, review and install for themselves.

Maybe it is time to switch to a more permissive browser. Or maybe all the major browsers are now in the business of building walled gardens. It's a sad world. I wonder how long it will be before Firefox starts making it difficult to browser sites other than Mozilla's own sites and sites of those who fund it? They have already made it impossible to browse sites for which Mozilla deems the security to be inadequate. This was good when I could review the problem and manually override where appropriate, but more recent releases give no option to proceed to the site: it is simply and utterly blocked with an unhelpful message. Attempting to browse other sites results in an alert but, thus far, one can still proceed to the site: it is just a matter of dealing with the alerts and clicking through. Add-ons? There are no practical options: only Mozilla approved add-ons are allowed. The walls are going up and, no doubt, will become higher with time, then the excuse of lack of resources will be used to bring them in to reduce the scope of support. 

It's a sad world we live in. Mozilla used to develop good, free software. It still is, to the extent that I could fork Firefox and remove the restrictions, but I don't have time for that.

No comments:

Labels