I am currently working on a Chrome extension and want it to work on Google Docs to highlight the text. Google docs is moving to the Canvas rendering for pages which basically removes all the text from the DOM and we only have a canvas
element in the DOM for every page.
I have noticed that by setting window._docs_force_html_by_ext = <extension-id>
on the Google docs webpage, we can force it to render DOM as HTML, not as canvas. This works fine for me. I have also seen some extensions set window._docs_annotate_canvas_by_ext = <extension-id>
and that ensures that the canvas rendered is annotated with a lot DOM elements inside the canvas element. This annotated canvas allows for positional computations for the text.
I have tried inserting the script the same way but it does not seem to have any effect on the DOM. Is there anything else I need to do?
Any help is highly appreciated. Thanks in advance.