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.
23 lines
622 B
23 lines
622 B
import './console-frame.scss'; |
|
|
|
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 blur = (doc) => { |
|
let iframe = doc.getElementById('vimvixen-console-frame'); |
|
iframe.blur(); |
|
}; |
|
|
|
const postMessage = (doc, message) => { |
|
let iframe = doc.getElementById('vimvixen-console-frame'); |
|
iframe.contentWindow.postMessage(JSON.stringify(message), '*'); |
|
}; |
|
|
|
export { initialize, blur, postMessage };
|
|
|