feat: [extensions] support extension.getBackgroundPage (#21951)

* feat: [extensions] support extension.getBackgroundPage

* cleanup

* how does c++

* tests

* test for runtime.getBackgroundPage too
This commit is contained in:
Jeremy Apthorp 2020-02-06 13:42:34 -08:00 committed by GitHub
parent eca1dd7f8b
commit 9107157073
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 217 additions and 23 deletions

View file

@ -9,6 +9,10 @@
"extension_types": ["extension"],
"contexts": ["blessed_extension"]
},
"extension.getBackgroundPage": {
"contexts": ["blessed_extension"],
"disallow_for_service_workers": true
},
"extension.getURL": {
"contexts": ["blessed_extension", "unblessed_extension", "content_script"]
}

View file

@ -12,6 +12,20 @@
"properties": {
},
"functions": [
{
"name": "getBackgroundPage",
"nocompile": true,
"type": "function",
"description": "Returns the JavaScript 'window' object for the background page running inside the current extension. Returns null if the extension has no background page.",
"parameters": [],
"returns": {
"type": "object",
"optional": true,
"name": "backgroundPageGlobal",
"isInstanceOf": "Window",
"additionalProperties": { "type": "any" }
}
},
{
"name": "getURL",
"deprecated": "Please use $(ref:runtime.getURL).",

View file

@ -1,6 +1,7 @@
[
{
"namespace": "tabs",
"description": "Use the <code>chrome.tabs</code> API to interact with the browser's tab system. You can use this API to create, modify, and rearrange tabs in the browser.",
"functions": [
{
"name": "executeScript",