electron/spec-main/fixtures/extensions/chrome-storage/main.js
2019-07-24 16:01:08 -07:00

7 lines
314 B
JavaScript

chrome.storage.local.set({key: 'value'}, () => {
chrome.storage.local.get(['key'], ({key}) => {
const script = document.createElement('script')
script.textContent = `require('electron').ipcRenderer.send('storage-success', ${JSON.stringify(key)})`
document.documentElement.appendChild(script)
})
})