Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer working on Google Docs? #83

Open
danielberni opened this issue Sep 4, 2021 · 16 comments
Open

No longer working on Google Docs? #83

danielberni opened this issue Sep 4, 2021 · 16 comments

Comments

@danielberni
Copy link

is it just me or it's no longer working on Google Docs anymore?
Other sites are working fine, but on Docs on Chrome or Firefox it does nothing, no error message, just it's not showing the translation anymore?
Any help here would be appreciated
thanks
Daniel

@cschiller
Copy link
Owner

Hi Daniel,

Google is making changes to how Google Docs documents are represented using HTML in your browser. As a result, Zhongwen is no longer working in Google Docs. These changes are currently being rolled out by Google and will soon affect every Google Docs user. Unfortunately, I can't think of a way to fix this, since the change fundamentally breaks how Zhongwen sees the page.

Maybe someone has found a workaround for this that they want to share?

@cschiller
Copy link
Owner

Here's some technical background information regarding the changes Google is making:

http://workspaceupdates.googleblog.com/2021/05/Google-Docs-Canvas-Based-Rendering-Update.html

@danielberni
Copy link
Author

danielberni commented Sep 6, 2021 via email

@cschiller
Copy link
Owner

Daniel, thanks for sharing your Office 365 workaround. I'm aware of the fact that many Zhongwen users are using it in combination with Google Docs. Unfortunately, the way things stand with the changes Google is making, it's near impossible to fix. I can't think of a way to make it work with the canvas element. Google managed to thoroughly break it. Maybe there's a way to write a new extension specifically for Google Docs. But as far as Zhongwen is concerned, it will sadly not be possible to use it with the redesigned Google Docs.

@ecaivassar
Copy link

ecaivassar commented Oct 9, 2021

The Rikaikun extension which has similar functions as this but for Japanese, seems to still work on Google Docs. When I launch the extension, it specifically says "rikaikun is forcing Google Docs to render using HTML instead of canvas. rikaikun can't work with canvas mode but if you need that mode, please disable rikaikun". Maybe a similar workaround can be implemented? Not sure how one might disable the canvas rendering, however.

As a workaround, you can install rikaikun, and the two extensions can work together, allowing you to use Zhongwen again.

@chinese-words-separator
Copy link

chinese-words-separator commented Oct 25, 2021

The Rikaikun extension which has similar functions as this but for Japanese, seems to still work on Google Docs. When I launch the extension, it specifically says "rikaikun is forcing Google Docs to render using HTML instead of canvas. rikaikun can't work with canvas mode but if you need that mode, please disable rikaikun". Maybe a similar workaround can be implemented? Not sure how one might disable the canvas rendering, however.

As a workaround, you can install rikaikun, and the two extensions can work together, allowing you to use Zhongwen again.

Checked the code, I wonder where rikaikun found the code to force HTML for Google Docs:

const injectedCode = `(function() {window['_docs_force_html_by_ext'] = '${chrome.runtime.id}';})();`;

const script = document.createElement('script');

script.textContent = injectedCode;

// Usually, `document.head` isn't guaranteed to be present when content_scripts run but in this case
// we're running inside a callback so it should be 100% safe.
document.head.appendChild(script);

https://github.com/melink14/rikaikun/blob/94b60a64303d60ff08a05e71ec706a33da346821/extension/docs-html-fallback.ts

Tried googling _docs_force_html_by_ext, nothing turns up. Seems like an undocumented API

And this does not work in manifest v3, error is about Content Security Policy:

document.head.appendChild(script);

Hope someone will make a Chrome extension (manifest v3 preferably) that forces HTML for Google Docs, just for this purpose :)

Problem though is even if someone make a Force HTML on Google Doc Chrome extension, Google might permanently stop supporting that undocumented API

@cschiller
Copy link
Owner

I've looked into this already. Unfortunately, this is a temporary feature that Google will remove once the rollout of canvas-based rendering is complete. So in the near future, Google Docs will stop working for Rikaikun in its current form as well.

@LanguageLeanerJ
Copy link

I am sad this extension is no longer working with Google Docs. Its such a good extension for language learners. So sad. I hope there is a new version in the future based on the Canvas based coding.

@jmlarch
Copy link

jmlarch commented Feb 7, 2022

FWIW, I've moved the content of the google documents for which I needed Zhongwen to zoho.com. Functionally, I'd say it is richer than gdocs; but there are occasional slowdowns, especially for longer documents.

@leoyangdiary
Copy link

leoyangdiary commented Feb 25, 2022

" Maybe there's a way to write a new extension specifically for Google Docs ".
this method you mentioned , I just want it to work in google docs , if I were to hire a guy (perhaps you haha) to accomplish this purpose for me , just how much it will cost , if its not that much , Id love to do it . if its too much , I think you can start a fundraising , I d happy to help and I believe many others as well , this extension is so good and too bad to see it `s not working no more , thanks , looking forward to your reply .

@cristobalwong
Copy link

Does anyone know if this problem may be fixable in the future? Really love this program and bummed to see it not working!

@chinese-words-separator
Copy link

chinese-words-separator commented Oct 5, 2022

A work-around to use Chinese pop-up dictionary on Google Docs

To pop-up the dictionary, need to press Alt key ( option key on mac ) while hovering the mouse cursor on the pasted Chinese text in CWS's Notes

work-around-for-google-doc-move-to-canvas-tech

@LanguageLeanerJ
Copy link

LanguageLeanerJ commented Oct 14, 2022 via email

@danielberni
Copy link
Author

danielberni commented Oct 14, 2022 via email

@mkarang
Copy link

mkarang commented Oct 23, 2022

I used Google Doc because it's a convenient way to paste chinese text into browser so that I can use ZhongWen extension. Now I found out I don't have to do that. Just save your txt file locally, and open it directly on the browser (drag the text file to Chrome window). You need to follow this instruction for the hover to work:
#85 (comment)

EDIT: please disregard the above. See workaround below ("Read Offline"); it's much better.

@chinese-words-separator
Copy link

chinese-words-separator commented Oct 23, 2022

I used Google Doc because it's a convenient way to paste chinese text into browser so that I can use ZhongWen extension. Now I found out I don't have to do that. Just save your txt file locally, and open it directly on the browser (drag the text file to Chrome window). You need to follow this instruction for the hover to work: #85 (comment)

If you were primarily using Google Docs to use pop-up dictionaries for reading Chinese text; and now that pop-up dictionaries can't work in Google Docs, you can use CWS's Read Offline functionality instead:

image

Here's how Read Offline works:

image

By the way, Read Offline has a Parallel Text functionality, wherein you can see the parallel English text of the Chinese text you pasted or typed. To activate parallel text, press this button: ||, it's next to this button New. See the left portion of screenshot above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants