summaryrefslogtreecommitdiff
path: root/ext/js/accessibility/google-docs.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/accessibility/google-docs.js')
-rw-r--r--ext/js/accessibility/google-docs.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/ext/js/accessibility/google-docs.js b/ext/js/accessibility/google-docs.js
index f9290078..da6ab994 100644
--- a/ext/js/accessibility/google-docs.js
+++ b/ext/js/accessibility/google-docs.js
@@ -18,9 +18,17 @@
(async () => {
// Reentrant check
+ // @ts-ignore : Checking a property to the global object
if (self.googleDocsAccessibilitySetup) { return; }
+ // @ts-ignore : Adding a property to the global object
self.googleDocsAccessibilitySetup = true;
+ /**
+ * @template [TReturn=unknown]
+ * @param {string} action
+ * @param {import('core').SerializableObject} params
+ * @returns {Promise<TReturn>}
+ */
const invokeApi = (action, params) => {
return new Promise((resolve, reject) => {
chrome.runtime.sendMessage({action, params}, (response) => {
@@ -37,6 +45,7 @@
};
const optionsContext = {depth: 0, url: location.href};
+ /** @type {import('api').OptionsGetResult} */
let options;
try {
options = await invokeApi('optionsGet', {optionsContext});
@@ -48,9 +57,8 @@
// The extension ID below is on an allow-list that is used on the Google Docs webpage.
/* eslint-disable */
- const inject = () => {
- window._docs_annotate_canvas_by_ext = 'ogmnaimimemjmbakcfefmnahgdfhfami';
- };
+ // @ts-ignore : Adding a property to the global object
+ const inject = () => { window._docs_annotate_canvas_by_ext = 'ogmnaimimemjmbakcfefmnahgdfhfami'; };
/* eslint-enable */
let parent = document.head;