aboutsummaryrefslogtreecommitdiff
path: root/ext/js/accessibility/google-docs.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2022-09-24 22:44:40 -0400
committerGitHub <noreply@github.com>2022-09-24 22:44:40 -0400
commit8240482e9d0b6da7a996bc581c9b5304ebcf22aa (patch)
tree4d1621193b9990f6cb710a72f9b761aa2b471de6 /ext/js/accessibility/google-docs.js
parentda52caa15247f82377e5d914306de1713ed63cea (diff)
Google Docs accessibility update (#2235)
* Update Google Docs injection script * Create GoogleDocsUtil * Update Frontend.js to register GoogleDocsUtil's getRangeFromPoint handler * Update setting name and description * Add comment * Fix Firefox support
Diffstat (limited to 'ext/js/accessibility/google-docs.js')
-rw-r--r--ext/js/accessibility/google-docs.js29
1 files changed, 2 insertions, 27 deletions
diff --git a/ext/js/accessibility/google-docs.js b/ext/js/accessibility/google-docs.js
index 412ccf60..a3e4e4b1 100644
--- a/ext/js/accessibility/google-docs.js
+++ b/ext/js/accessibility/google-docs.js
@@ -45,35 +45,10 @@
if (!options.accessibility.forceGoogleDocsHtmlRendering) { return; }
+ // The extension ID below is on an allow-list that is used on the Google Docs webpage.
/* eslint-disable */
const inject = () => {
- const start = Date.now();
- const maxDuration = 10000;
- const updateDocData = () => {
- const target = window._docs_flag_initialData;
- if (typeof target === 'object' && target !== null) {
- try {
- target['kix-awcp'] = true;
- } catch (e) {
- // NOP
- }
- } else if (Date.now() - start < maxDuration) {
- setTimeout(updateDocData, 0);
- }
- };
- const params = new URLSearchParams(location.search);
- if (params.get('mode') !== 'html') {
- const url = new URL(location.href);
- params.set('mode', 'html');
- url.search = params.toString();
- try {
- history.replaceState(history.state, '', url.toString());
- } catch (e) {
- // Ignore
- }
- }
- window._docs_force_html_by_ext = true;
- updateDocData();
+ window._docs_annotate_canvas_by_ext = 'ogmnaimimemjmbakcfefmnahgdfhfami';
};
/* eslint-enable */