This repository has been archived on 2020-04-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Vim-Vixen/src/content/presenters/ConsoleFramePresenter.ts
2019-05-19 10:50:49 +09:00

25 lines
646 B
TypeScript

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();
}
}