electron/spec-main/fixtures/extensions/lazy-background-page/runtime-get-background-page.js

10 lines
302 B
JavaScript
Raw Normal View History

/* global chrome */
window.completionPromise = new Promise((resolve) => {
window.completionPromiseResolve = resolve
})
chrome.runtime.sendMessage({ some: 'message' }, (response) => {
chrome.runtime.getBackgroundPage((bgPage) => {
window.completionPromiseResolve(bgPage.receivedMessage)
})
})