aboutsummaryrefslogtreecommitdiff
path: root/src/content/presenters/ConsoleFramePresenter.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/presenters/ConsoleFramePresenter.ts')
-rw-r--r--src/content/presenters/ConsoleFramePresenter.ts25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/content/presenters/ConsoleFramePresenter.ts b/src/content/presenters/ConsoleFramePresenter.ts
new file mode 100644
index 0000000..3c7477b
--- /dev/null
+++ b/src/content/presenters/ConsoleFramePresenter.ts
@@ -0,0 +1,25 @@
+export default interface ConsoleFramePresenter {
+ initialize(): void;
+
+ blur(): void;
+
+ // eslint-disable-next-line semi
+}
+
+export class ConsoleFramePresenterImpl implements ConsoleFramePresenter {
+ initialize(): void {
+ let iframe = document.createElement('iframe');
+ iframe.src = browser.runtime.getURL('build/console.html');
+ iframe.id = 'vimvixen-console-frame';
+ iframe.className = 'vimvixen-console-frame';
+ document.body.append(iframe);
+ }
+
+ blur(): void {
+ let ele = document.getElementById('vimvixen-console-frame');
+ if (!ele) {
+ throw new Error('console frame not created');
+ }
+ ele.blur();
+ }
+}