aboutsummaryrefslogtreecommitdiff
path: root/src/background/operators/impls/OpenSourceOperator.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/operators/impls/OpenSourceOperator.ts')
-rw-r--r--src/background/operators/impls/OpenSourceOperator.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/background/operators/impls/OpenSourceOperator.ts b/src/background/operators/impls/OpenSourceOperator.ts
new file mode 100644
index 0000000..9185ba5
--- /dev/null
+++ b/src/background/operators/impls/OpenSourceOperator.ts
@@ -0,0 +1,12 @@
+import Operator from "../Operator";
+import TabPresenter from "../../presenters/TabPresenter";
+
+export default class OpenSourceOperator implements Operator {
+ constructor(private readonly tabPresenter: TabPresenter) {}
+
+ async run(): Promise<void> {
+ const tab = await this.tabPresenter.getCurrent();
+ const url = "view-source:" + tab.url;
+ await this.tabPresenter.create(url);
+ }
+}