feat: add chrome.runtime.getManifest (#16891)

* feat: add chrome.runtime.getManifest

* Add test for chrome.runtime.getManifest

* Use IPC utils for getManifest internals
This commit is contained in:
Samuel Maddock 2019-02-13 12:16:12 -05:00 committed by John Kleinschmidt
parent 46f818b0c3
commit 8f6a543398
5 changed files with 89 additions and 0 deletions

View file

@ -169,6 +169,14 @@ ipcMainInternal.on('CHROME_RUNTIME_CONNECT', function (event, extensionId, conne
page.webContents._sendInternalToAll(`CHROME_RUNTIME_ONCONNECT_${extensionId}`, event.sender.id, portId, connectInfo)
})
ipcMainUtils.handleSync('CHROME_EXTENSION_MANIFEST', function (event, extensionId) {
const manifest = manifestMap[extensionId]
if (!manifest) {
throw new Error(`Invalid extensionId: ${extensionId}`)
}
return manifest
})
let resultID = 1
ipcMainInternal.on('CHROME_RUNTIME_SENDMESSAGE', function (event, extensionId, message, originResultID) {
const page = backgroundPages[extensionId]