<script>
const { ipcRenderer } = require('electron');
caches.open('foo').then(
() => ipcRenderer.send('success'),
err => ipcRenderer.send('failure', err)
)
</script>