aboutsummaryrefslogtreecommitdiff
path: root/ext/js/background/backend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-12-27 09:48:35 -0500
committerGitHub <noreply@github.com>2023-12-27 14:48:35 +0000
commit623e056fe6322c1d0f07554aea2fabf2f834e8a5 (patch)
tree6040ee8396363f00b0d2fbf05ca9de2b611e0b5f /ext/js/background/backend.js
parent860374fdab25fce3161ee835be0e141a341b9b9b (diff)
Script manager cleanup (#456)
* Remove unused functions * Remove fallback code * Simplify injectStylesheet * Simplify unregisterContentScript * Merge functions * Simplify registration details * Simplify injectScript * Remove class wrapper * Remove unused injectScript
Diffstat (limited to 'ext/js/background/backend.js')
-rw-r--r--ext/js/background/backend.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js
index 5ef3c3be..0604fe8b 100644
--- a/ext/js/background/backend.js
+++ b/ext/js/background/backend.js
@@ -40,7 +40,7 @@ import {MediaUtil} from '../media/media-util.js';
import {ClipboardReaderProxy, DictionaryDatabaseProxy, OffscreenProxy, TranslatorProxy} from './offscreen-proxy.js';
import {ProfileConditionsUtil} from './profile-conditions-util.js';
import {RequestBuilder} from './request-builder.js';
-import {ScriptManager} from './script-manager.js';
+import {injectStylesheet} from './script-manager.js';
/**
* This class controls the core logic of the extension, including API calls
@@ -110,10 +110,8 @@ export class Backend {
});
/** @type {OptionsUtil} */
this._optionsUtil = new OptionsUtil();
- /** @type {ScriptManager} */
- this._scriptManager = new ScriptManager();
/** @type {AccessibilityController} */
- this._accessibilityController = new AccessibilityController(this._scriptManager);
+ this._accessibilityController = new AccessibilityController();
/** @type {?number} */
this._searchPopupTabId = null;
@@ -650,7 +648,7 @@ export class Backend {
async _onApiInjectStylesheet({type, value}, sender) {
const {frameId, tab} = sender;
if (typeof tab !== 'object' || tab === null || typeof tab.id !== 'number') { throw new Error('Invalid tab'); }
- return await this._scriptManager.injectStylesheet(type, value, tab.id, frameId, false);
+ return await injectStylesheet(type, value, tab.id, frameId, false);
}
/** @type {import('api').ApiHandler<'getStylesheetContent'>} */