refactor: migrate standalone scripts to the new DI architecture
Bug: twpowertools:226
Change-Id: Ie32b0200a31626bde06f3bdb0655790bb5a76802
diff --git a/src/presentation/standaloneScripts/xhrInterceptor/xhrInterceptor.script.ts b/src/presentation/standaloneScripts/xhrInterceptor/xhrInterceptor.script.ts
new file mode 100644
index 0000000..d2b146f
--- /dev/null
+++ b/src/presentation/standaloneScripts/xhrInterceptor/xhrInterceptor.script.ts
@@ -0,0 +1,21 @@
+import Script, {
+ ScriptEnvironment,
+ ScriptPage,
+ ScriptRunPhase,
+} from '../../../common/architecture/scripts/Script';
+import { injectScript } from '../../../common/contentScriptsUtils';
+
+export default class XHRInterceptorScript extends Script {
+ priority = 10;
+
+ page = ScriptPage.CommunityConsole;
+ environment = ScriptEnvironment.ContentScript;
+ runPhase = ScriptRunPhase.Start;
+
+ execute() {
+ injectScript(
+ chrome.runtime.getURL('xhrInterceptorInject.bundle.js'),
+ /* prepend = */ true,
+ );
+ }
+}