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/console/frames.js
2017-09-10 16:05:13 +09:00

27 lines
725 B
JavaScript

import './console-frame.scss';
import * as consoleActions from '../actions/console';
const initialize = (doc) => {
let iframe = doc.createElement('iframe');
iframe.src = browser.runtime.getURL('build/console.html');
iframe.id = 'vimvixen-console-frame';
iframe.className = 'vimvixen-console-frame';
doc.body.append(iframe);
return iframe;
}
const showCommand = (text) => {
return browser.runtime.sendMessage(consoleActions.showCommand(text));
};
const showError = (text) => {
return browser.runtime.sendMessage(consoleActions.showError(text));
}
const blur = (doc) => {
let iframe = doc.getElementById('vimvixen-console-frame');
iframe.blur();
}
export { initialize, showCommand, showError, blur };