A fork of https://github.com/ueokande/vim-vixen
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
610 B
24 lines
610 B
5 years ago
|
export default interface ConsoleFramePresenter {
|
||
|
initialize(): void;
|
||
|
|
||
|
blur(): void;
|
||
|
}
|
||
|
|
||
|
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();
|
||
|
}
|
||
|
}
|