electron/spec/fixtures/module/preload-pdf-loaded-in-subframe.js

11 lines
322 B
JavaScript
Raw Normal View History

2017-10-19 14:15:02 +00:00
const {ipcRenderer} = require('electron')
2017-10-20 06:46:41 +00:00
document.addEventListener('DOMContentLoaded', function (event) {
var subframe = document.getElementById('pdf-frame')
2017-10-19 14:15:02 +00:00
if (subframe) {
subframe.contentWindow.addEventListener('pdf-loaded', function (event) {
2017-10-20 06:46:41 +00:00
ipcRenderer.send('pdf-loaded', event.detail)
})
2017-10-19 14:15:02 +00:00
}
2017-10-20 06:46:41 +00:00
})