Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Google Docs accessibility update #2235

Conversation

toasted-nutbread
Copy link
Collaborator

@toasted-nutbread toasted-nutbread commented Sep 24, 2022

This change updates the implementation of the Google Docs accessibility scripts and restores some support for scanning on Google Docs pages. It currently lacks the ability to select text, since there is no real text, but it otherwise functions similar to how scanning input elements works: by creating a temporary "imposter" element and then scanning it.

Google exposes some structural text information in a hidden <svg> element if window._docs_annotate_canvas_by_ext is assigned to a whitelisted extension ID. This change registers an extension to DocumentUtil which will handle the scanning on Google Docs webpages.

The extension ID whitelist can be found by viewing the source of the main Google Docs script and searching for an ID which is known to be on the list, at least at the time of writing this. There is a big array of extension IDs, and Yomichan's ID ogmnaimimemjmbakcfefmnahgdfhfami is on that list, which is nice. (Maybe filling out that form mentioned in this comment actually did something!)

This implementation is still subject to the whims of Google's changes, which are unpredictable and undocumented.

Resolves #2231.
Related: #2093, #305 (comment).

@gadicc
Copy link

gadicc commented Sep 25, 2022

Massive thanks for this. All my Japanese learning notes are in Google Docs... I've been getting by with 10ten (Rikaichamp) but have been missing Yomichan so much!

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

Successfully merging this pull request may close these issues.

Is there a way to make Yomichan work on Google Docs again?
2 participants