electron/spec/fixtures/module/preload-pdf-loaded-in-subframe.js
2020-03-20 13:28:31 -07:00

10 lines
319 B
JavaScript

const { ipcRenderer } = require('electron');
document.addEventListener('DOMContentLoaded', (event) => {
const subframe = document.querySelector('#pdf-frame');
if (subframe) {
subframe.contentWindow.addEventListener('pdf-loaded', (event) => {
ipcRenderer.send('pdf-loaded', event.detail);
});
}
});