30 lines
839 B
HTML
30 lines
839 B
HTML
<html>
|
|
<body>
|
|
<script type="text/javascript" charset="utf-8">
|
|
const {ipcRenderer} = require("electron");
|
|
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);
|
|
};
|
|
},
|
|
'native-addon': () => {
|
|
const runas = require('runas');
|
|
ipcRenderer.send('answer', typeof runas);
|
|
}
|
|
}
|
|
const test = location.hash.slice(1);
|
|
if (tests.hasOwnProperty(test)) {
|
|
tests[test]();
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|