use iframe-ed command-line
This commit is contained in:
parent
a808b28940
commit
dc42864607
6 changed files with 140 additions and 26 deletions
src/command-line
19
src/command-line/command-line-frame.js
Normal file
19
src/command-line/command-line-frame.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
import './command-line-frame.scss';
|
||||
|
||||
export default class CommandLineFrame {
|
||||
constructor(win, initial = '') {
|
||||
let url = browser.runtime.getURL('build/command-line.html') +
|
||||
'#' + encodeURIComponent(initial);
|
||||
|
||||
let element = window.document.createElement('iframe');
|
||||
element.src = url;
|
||||
element.className = 'vimvixen-command-line-frame';
|
||||
win.document.body.append(element);
|
||||
|
||||
this.element = element;
|
||||
}
|
||||
|
||||
remove() {
|
||||
this.element.remove();
|
||||
}
|
||||
}
|
Reference in a new issue