electron/spec-main/fixtures/extensions/lazy-background-page/runtime-get-background-page.js
Jeremy Apthorp 9107157073
feat: [extensions] support extension.getBackgroundPage (#21951)
* feat: [extensions] support extension.getBackgroundPage

* cleanup

* how does c++

* tests

* test for runtime.getBackgroundPage too
2020-02-06 16:42:34 -05:00

9 lines
302 B
JavaScript

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