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:
parent
46f818b0c3
commit
8f6a543398
5 changed files with 89 additions and 0 deletions
15
spec/fixtures/extensions/chrome-api/main.js
vendored
Normal file
15
spec/fixtures/extensions/chrome-api/main.js
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
/* global chrome */
|
||||
|
||||
const testMap = {
|
||||
getManifest () {
|
||||
const manifest = chrome.runtime.getManifest()
|
||||
console.log(JSON.stringify(manifest))
|
||||
}
|
||||
}
|
||||
|
||||
const dispatchTest = (event) => {
|
||||
const testName = event.data
|
||||
const test = testMap[testName]
|
||||
test()
|
||||
}
|
||||
window.addEventListener('message', dispatchTest, false)
|
12
spec/fixtures/extensions/chrome-api/manifest.json
vendored
Normal file
12
spec/fixtures/extensions/chrome-api/manifest.json
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"name": "chrome-api",
|
||||
"version": "1.0",
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["<all_urls>"],
|
||||
"js": ["main.js"],
|
||||
"run_at": "document_start"
|
||||
}
|
||||
],
|
||||
"manifest_version": 2
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue