-
Notifications
You must be signed in to change notification settings - Fork 251
Yomichan sometimes causes Google Docs to produce errors #608
Comments
|
What browser are you using? Google Chrome Version 83.0.4103.97 (Official Build) (64-bit) When the issue does happen, does it only happen the first time the popup is opened? Or can it happen later on? It doesn't typically happen the first time the popup comes up; it seems kind of random as to when the issue occurs. Then, when I reload the Google Doc (either by hitting the Refresh button on the browser, or by hitting the Reload button in the Google error message in the screenshot I posted earlier) it'll work again for a short time until it happens on another random pop-up. Does it happen on all documents (that you've tried)? You mention that it happens on more than one, but I'm curious if it's on every document. I can't definitively say if it happens on EVERY document, but it did happen on the several different ones I tried. Do you have any docs that you can reliably reproduce on? Today it was happening a lot on one short document I have, so that might be a good one to work with. I could share it with you if you like, just send me a pm or post the email I should share it with. I'd prefer to share it read-only if that's OK. I wasn't editing the doc at all today (only using it to study, with Yomichan), and the problem still occurred. If you need it to be editable, that's OK, I'll just make a backup. Can you export and share your settings file from the settings page? I don't think I've customized my installation much, but here are my exported settings. Do you have any other extensions installed? Yes, here's a list of my active extensions: |
If you are able to export the document to a .docx (File > Download > Microsoft Word (.docx)), I think I can just import that onto my testing account. Feel free to remove anything from it before sharing; my limited test case I've used in GDocs before is currently not exhibiting the issue. I have a few guesses as to where the issue might be coming from; I've already identified a place where GDocs causes Yomichan to throw an error, so I'll be looking into that. |
Thanks. Here's the docx... I didn't change anything in it, so it should hopefully match what I'm looking at exactly. |
Forgot to ask earlier: if you click the "send an error report" text, does it show any information? Still doing some testing and I haven't been able to reproduce the issue yet. |
I also meant to mention this above, in case it helps. I already said that if I press the middle mouse button and do not move the mouse, Yomichan does not scan and the problem does not occur. However, my next scan (even a shift-key scan) will then always trigger the problem. |
I don't know if this is helpful, but I've noticed that if I leave a gdocs window open for a long time, when I eventually go back to it, I usually get the issue on the first lookup I try to do. I don't know if this is a time-based thing, or if it's something else (like losing & restoring network, or sleeping and resuming my PC). |
I've tried to reproduce following the different steps you've listed, but so far I have not been able to reproduce the problem. Yomichan has a very small set of operations which are able to be detected by the underlying website, which currently includes:
You could try disabling the "Select matched text" and "Deep DOM scan" options and see if you still get the problem. Otherwise, it's not clear how Yomichan is causing the issue. One last thing you could check is the dev console after the error occurs. Press F12, open the Console tab, and see if there is anything listed in there. |
Deep DOM Scan was already off, and disabling Select Matched Text didn't fix the issue. (I made sure to reload the gdocs page after changing the option, in case that was necessary.) I tried to produce the error with Yomichan turned off, but nothing happened when I performed the same steps that normally reproduce it 100% of the time (click middle mouse button, then press left shift while moving the mouse). I tried to rule out Yomichan by using the Rikaikun browser extension instead. I disabled Yomichan prior to enabling Rikaikun. However, I was unable to reproduce the problem when using Rikaikun. I tested with several different options within Rikaikun such as requiring a key press to generate the pop-up, or not requiring a key. I also tried sleeping and resuming my computer, since that seemed to cause the problem to happen more frequently, but the issue still did not occur. I don't usually use gdocs from my Chromebook, but I tried today and could not reproduce the issue there. The PC where I am experiencing the issue is Windows 10 Home, 10.0.19041 (not sure if it's apparent from the version number or not, but I've already applied the latest "big" update from the past month or so). I did as you suggested and looked at the dev console when the error occurs. Here are a few screenshots of what appears. I checked a few times and the errors were the same each time. Let me know if there's anything useful here, or if anything else from this window would be helpful. |
I just realized I had only looked at the console after I had reproduced the issue, so I didn't know if any of the errors were already there before the issue occurred. I just now checked and the first two errors in my screenshot (the deprecation and the TypeError) are there on a fresh reload of gdocs, before the issue occurs. The third one (the "JJa" error) only appears when the error occurs. |
The one about 'Cannot destructure property ...' is an error Yomichan is having, but it's passive for the most part and doesn't break anything. This has since been fixed. The 'JJa' one is lkely the offending error. If you could get that error again and expand the details (click the arrows/...) on the |
The
The |
So the error is kind of reproducible by typing |
Do you have any ideas on stuff I could try to do to avoid the error? For example, Chrome options, other extensions to disable, etc.? (Although as far as I know, my PC and Chromebook have the same Chrome settings and extensions, and I haven't been able to reproduce on my Chromebook.) Or if there's some kind of further debugging I could do to help figure out why gdocs is (incorrectly) accessing the yomichan frame, please let me know. |
I tried a couple more things, but they didn't fix the issue:
I also tested other types of Google documents:
DOMException contents:
2. Slides produces a similar error. Yomichan doesn't seem to work on content within a slide, but I was able to trigger the issue inside the "Word art" popup (Insert menu -> Word art -> Type in pop-up). As with Sheets, I didn't have to do anything special to make the issue occur here, and it occurs 100% of the time. DOMException contents:
|
Thanks for the detailed information. Even trying it on the sheets/slides pages, I get no issues. I do have one more thing that you can try, but it's not a good long term solution. The change is that recently we changed the way that the Yomichan popup is assigned its content URL, and maybe GDocs will behave if Yomichan uses the old method. Here is a packaged extension, created from #618. What you will have to do to use this is to:
This is not a great long-term solution, as it allows fingerprinting of Yomichan because the extension URL is exposed. I will be working on trying other solutions as well. |
I just finished testing the developer version you shared with me. When the unsecure frame option is on, I could not reproduce the issue, so I think you nailed it. I didn't test with every Google document type, but I did try both Docs and Sheets. In the situations where I could consistently reproduce the issue before, the issue no longer occurs at all. I also tried the developer version with the unsecure frame option turned off, and the problem happens as usual. |
By the way, it's not related to this issue, but when I was re-downloading the dictionary files from the Yomichan page, I noticed something that seemed wrong. https://foosoft.net/projects/yomichan/ The circled links both go to the same site, which is a page for ENAMDICT/JMnedict, and not JMDict. |
Okay, so I think GDocs is somehow erroneously detecting the frame as something it has ownership over when there is no URL assigned directly to the object. Still unclear why it is not able to be reproduced, but oh well. If you're comfortable using the dev release I made, you can use that for now. I'll work on fixing some things up, adding that option to the full release, and work on adding a better solution that maintains security.
Fixed in #619. |
Are there any downsides to me using the dev release for now? Like, does it somehow leave me insecure as I'm browsing the web with it active? (Other than the issue with potential browser fingerprinting, which I understand.) Also, can I turn off "Developer Mode" in the Extensions page? I'm not sure if that was only required for installation, or if I need to keep it on for the dev release to continue to work. Thanks for all your help with this. |
Should be the same security as the real release. This is how extension developers test extensions before deploying them to the store.
You can turn it off if you like. All it does is show some more options on that page (like the "Load unpacked" button, and such). |
I have done some work on a better solution for the issue you have been experiencing, which should increase the security and integrity of the popup frame overall. The popup frame is now enclosed inside of a container which the scripts on the underlying page should not be able to be see inside. This means that GDocs shouldn't try to use the popup frame since it won't know it's there. Here is a new release which is created off of #623. Try this release with both options "Use secure popup frame URL" and "Use shadow DOM container for popup" (new) checked (which is the default). Hopefully this should fix your issue without having to disable any security features. Note: the old option "Use unsecure popup frame URL" has been replaced with with the new "Use secure popup frame URL", which has the opposite value. |
The new version looks great. I have both of those options on, and I cannot reproduce the issue. |
@toasted-nutbread this seems like a pretty solid fix that should be in a release; is there anything else you want to flight in a test build, or are things in a good state? |
Give me a day or two to do some testing with the changes made so far; if there are no issues, I'll let you know that it's good to go. I don't think I need to add any more big features/changes for this release; only small fixes and whatnot. |
|
|
Bingo. I restored the folders from the Recycle Bin, restarted Chrome, and they were back. Sorry for the false alarm! |
FYI @Ceiyne, the dev version has been updated with the latest fixes, and the standard version typically gets updated ~1 week after. |
Thank you! |
When I'm working in a Google Doc that has Japanese, Yomichan works fine most of the time. However, every now and again when I try to use Yomichan to look up a word, the Yomichan pop-up will appear but the Google Doc site will immediately produce an error saying "Unable to load file. Try to load it again or send an error report.".
When this happens, another error shows at the top of the page reading "Something went wrong. Reload" and the status of the connection to Google Docs changes to "Working offline". The only way to continue working with that file is to reload the document. I've attached a screenshot showing all of this.
I was able to reproduce this behavior in several different Google Docs that I tried so it does not seem to be specific to a document. As I mentioned above, this doesn't happen on every look-up; if I'm looking up a lot of words, it'll usually happen every few minutes.
I went through a period recently where I didn't use Google Docs much, but I used to be a heavy user and I don't recall running into this before. So, I'd guess it's a relatively new problem that wasn't occurring a few months ago.
The text was updated successfully, but these errors were encountered: