summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common/extensions')
-rw-r--r--chrome/common/extensions/api/_api_features.json26
-rw-r--r--chrome/common/extensions/api/app.json2
-rw-r--r--chrome/common/extensions/api/extension_api_unittest.cc19
3 files changed, 36 insertions, 11 deletions
diff --git a/chrome/common/extensions/api/_api_features.json b/chrome/common/extensions/api/_api_features.json
index 1ed1017..e8d9acd 100644
--- a/chrome/common/extensions/api/_api_features.json
+++ b/chrome/common/extensions/api/_api_features.json
@@ -3,6 +3,26 @@
// found in the LICENSE file.
{
+ "app": {
+ "channel": "stable",
+ "extension_types": ["hosted_app", "extension"],
+ "contexts": [
+ "blessed_extension", "unblessed_extension", "content_script", "web_page"
+ ],
+ "matches": [
+ "http://*/*", "https://*/*", "chrome-extension://*/*", "file://*/*"
+ ]
+ },
+ "app.runtime": {
+ "channel": "stable",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:app.runtime"]
+ },
+ "app.window": {
+ "channel": "stable",
+ "contexts": ["blessed_extension"],
+ "dependencies": ["permission:app.window"]
+ },
"app.currentWindowInternal": {
"internal": true,
"channel": "stable",
@@ -21,7 +41,9 @@
"events": {
"internal": true,
"channel": "stable",
- "contexts": ["blessed_extension", "unblessed_extension", "content_script", "web_page"],
+ "contexts": [
+ "blessed_extension", "unblessed_extension", "content_script", "web_page"
+ ],
"matches": ["<all_urls>"]
},
"fileBrowserHandlerInternal": {
@@ -40,6 +62,6 @@
"extension_types": ["hosted_app"],
"contexts": ["blessed_extension", "web_page"],
// Any webpage can use the webstore API.
- "matches": [ "http://*/*", "https://*/*" ]
+ "matches": ["http://*/*", "https://*/*"]
}
}
diff --git a/chrome/common/extensions/api/app.json b/chrome/common/extensions/api/app.json
index 0faef3c..7735f63 100644
--- a/chrome/common/extensions/api/app.json
+++ b/chrome/common/extensions/api/app.json
@@ -6,8 +6,6 @@
{
"namespace": "app",
"nodoc": true,
- "unprivileged": true,
- "matches": [ "<all_urls>" ],
"types": [
{
"id": "Details",
diff --git a/chrome/common/extensions/api/extension_api_unittest.cc b/chrome/common/extensions/api/extension_api_unittest.cc
index f980b57..f32d451 100644
--- a/chrome/common/extensions/api/extension_api_unittest.cc
+++ b/chrome/common/extensions/api/extension_api_unittest.cc
@@ -172,10 +172,14 @@ TEST(ExtensionAPI, APIFeatures) {
{ "test2.foo", true, Feature::CONTENT_SCRIPT_CONTEXT, GURL() },
{ "test3", false, Feature::WEB_PAGE_CONTEXT, GURL("http://google.com") },
{ "test3.foo", true, Feature::WEB_PAGE_CONTEXT, GURL("http://google.com") },
- { "test3.foo", true, Feature::BLESSED_EXTENSION_CONTEXT, GURL() },
- { "test4", true, Feature::BLESSED_EXTENSION_CONTEXT, GURL() },
- { "test4.foo", false, Feature::BLESSED_EXTENSION_CONTEXT, GURL() },
- { "test4.foo", false, Feature::UNBLESSED_EXTENSION_CONTEXT, GURL() },
+ { "test3.foo", true, Feature::BLESSED_EXTENSION_CONTEXT,
+ GURL("http://bad.com") },
+ { "test4", true, Feature::BLESSED_EXTENSION_CONTEXT,
+ GURL("http://bad.com") },
+ { "test4.foo", false, Feature::BLESSED_EXTENSION_CONTEXT,
+ GURL("http://bad.com") },
+ { "test4.foo", false, Feature::UNBLESSED_EXTENSION_CONTEXT,
+ GURL("http://bad.com") },
{ "test4.foo.foo", true, Feature::CONTENT_SCRIPT_CONTEXT, GURL() },
{ "test5", true, Feature::WEB_PAGE_CONTEXT, GURL("http://foo.com") },
{ "test5", false, Feature::WEB_PAGE_CONTEXT, GURL("http://bar.com") },
@@ -380,11 +384,12 @@ TEST_F(ExtensionAPITest, URLMatching) {
EXPECT_TRUE(MatchesURL(api.get(), "app", "https://blah.net"));
EXPECT_TRUE(MatchesURL(api.get(), "app", "file://somefile.html"));
- // But not internal URLs (for chrome-extension:// the app API is injected by
- // GetSchemasForExtension).
+ // But not internal URLs.
EXPECT_FALSE(MatchesURL(api.get(), "app", "about:flags"));
EXPECT_FALSE(MatchesURL(api.get(), "app", "chrome://flags"));
- EXPECT_FALSE(MatchesURL(api.get(), "app",
+
+ // "app" should be available to chrome-extension URLs.
+ EXPECT_TRUE(MatchesURL(api.get(), "app",
"chrome-extension://fakeextension"));
// "storage" API (for example) isn't available to any URLs.