2017-03-19 09:11:20 +00:00
|
|
|
<html>
|
|
|
|
<body>
|
|
|
|
<script type="text/javascript" charset="utf-8">
|
|
|
|
const {ipcRenderer} = require("electron");
|
2017-04-04 10:05:13 +00:00
|
|
|
const tests = {
|
|
|
|
'blank': () => {
|
|
|
|
const popup = window.open();
|
|
|
|
popup.document.write('<h1>Hello</h1>');
|
|
|
|
const content = popup.document.querySelector('h1').innerText;
|
|
|
|
ipcRenderer.send('answer', content);
|
|
|
|
},
|
|
|
|
'file': () => {
|
|
|
|
const popup = window.open('native-window-open-child.html');
|
|
|
|
popup.onload = () => {
|
|
|
|
const content = popup.document.querySelector('h1').innerText;
|
|
|
|
ipcRenderer.send('answer', content);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const test = location.hash.slice(1);
|
|
|
|
if (tests.hasOwnProperty(test)) {
|
|
|
|
tests[test]();
|
|
|
|
}
|
2017-03-19 09:11:20 +00:00
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|