aboutsummaryrefslogtreecommitdiff
path: root/ext/js/background/backend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-11-23 22:08:30 -0500
committerGitHub <noreply@github.com>2021-11-23 22:08:30 -0500
commitd454b52a18127f782fafdf71534ea2c41f20ef44 (patch)
treebaa980dbd94d624d44bac2df3d691fb759d8300d /ext/js/background/backend.js
parentecc994a8bbd52a426434a549f8e3e68eba6e786e (diff)
Google Docs accessibility refactor (#2023)
* Skip urlRegex if it's used as a filter * Add getRequiredContentScriptRegistrationPermissions function * Add a reentrant check to google-docs.js * Remove script node * Move forceGoogleDocsHtmlRendering check into google-docs.js * Replace document-start.js usage with google-docs.js * Remove documentStart handling * Add missing parameter descriptions
Diffstat (limited to 'ext/js/background/backend.js')
-rw-r--r--ext/js/background/backend.js26
1 files changed, 0 insertions, 26 deletions
diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js
index db43ec57..4e86a23c 100644
--- a/ext/js/background/backend.js
+++ b/ext/js/background/backend.js
@@ -127,7 +127,6 @@ class Backend {
['triggerDatabaseUpdated', {async: false, contentScript: true, handler: this._onApiTriggerDatabaseUpdated.bind(this)}],
['testMecab', {async: true, contentScript: true, handler: this._onApiTestMecab.bind(this)}],
['textHasJapaneseCharacters', {async: false, contentScript: true, handler: this._onApiTextHasJapaneseCharacters.bind(this)}],
- ['documentStart', {async: false, contentScript: true, handler: this._onApiDocumentStart.bind(this)}],
['getTermFrequencies', {async: true, contentScript: true, handler: this._onApiGetTermFrequencies.bind(this)}]
]);
this._messageHandlersWithProgress = new Map([
@@ -747,12 +746,6 @@ class Backend {
return this._japaneseUtil.isStringPartiallyJapanese(text);
}
- _onApiDocumentStart(params, sender) {
- const {tab, frameId, url} = sender;
- if (typeof url !== 'string' || typeof tab !== 'object' || tab === null) { return; }
- this._updateTabAccessibility(url, tab.id, frameId);
- }
-
async _onApiGetTermFrequencies({termReadingList, dictionaries}) {
return await this._translator.getTermFrequencies(termReadingList, dictionaries);
}
@@ -2140,25 +2133,6 @@ class Backend {
}
}
- async _updateTabAccessibility(url, tabId, frameId) {
- let file = null;
-
- switch (new URL(url).hostname) {
- case 'docs.google.com':
- {
- const optionsContext = {depth: 0, url};
- const options = this._getProfileOptions(optionsContext);
- if (!options.accessibility.forceGoogleDocsHtmlRendering) { return; }
- file = 'js/accessibility/google-docs.js';
- }
- break;
- }
-
- if (file === null) { return; }
-
- await this._scriptManager.injectScript(file, tabId, frameId, false, true, 'document_start');
- }
-
async _getNormalizedDictionaryDatabaseMedia(targets) {
const results = await this._dictionaryDatabase.getMedia(targets);
for (const item of results) {