electron/spec/fixtures/pages/geolocation/index.html

12 lines
300 B
HTML

<script>
const ipcRenderer = require('electron').ipcRenderer;
navigator.geolocation.getCurrentPosition((position) => {
ipcRenderer.send(position);
}, (error) => {
if (error) {
ipcRenderer.send('success')
} else {
ipcRenderer.send('unexpected error')
}
})
</script>