aboutsummaryrefslogtreecommitdiff
path: root/src/content/console-frames.ts
blob: b1b9bf67ba871bec6cd1bd38bf53cc36d80a0550 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const initialize = (doc: Document): HTMLIFrameElement => {
  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: Document) => {
  let ele = doc.getElementById('vimvixen-console-frame') as HTMLIFrameElement;
  ele.blur();
};

export { initialize, blur };