* Create an iframe
()
| 30 | * Create an iframe |
| 31 | */ |
| 32 | create() { |
| 33 | return new Promise((resolve, reject) => { |
| 34 | this.createPromise = {resolve, reject}; |
| 35 | const url = chrome.runtime.getURL(`components/key-backup/backupKey.html?id=${this.id}`); |
| 36 | this.parent = document.querySelector(this.selector); |
| 37 | this.container = document.createElement('iframe'); |
| 38 | this.port.emit('set-keybackup-window-props', { |
| 39 | host, |
| 40 | keyringId: this.keyringId, |
| 41 | initialSetup: (this.options.initialSetup === undefined) ? true : this.options.initialSetup |
| 42 | }); |
| 43 | this.container.setAttribute('src', url); |
| 44 | this.container.setAttribute('frameBorder', 0); |
| 45 | this.container.setAttribute('scrolling', 'no'); |
| 46 | this.container.style.width = '100%'; |
| 47 | this.container.style.height = '100%'; |
| 48 | this.parent.appendChild(this.container); |
| 49 | }); |
| 50 | } |
| 51 | |
| 52 | registerEventListener() { |
| 53 | this.port.on('popup-isready', this.onPopupReady); |
no test coverage detected