Commit f35769c8 authored by Noel Gordon's avatar Noel Gordon Committed by Chromium LUCI CQ

[imageloader] Make chrome://file-manager externally connectable

Allow chrome://file-manager to connect to the image loader. Note: this
assumes chrome://file-manager has enabled chrome.runtime.sendMessage.

Since the manifest.json "externally_connectable" permission is used to
allow chrome://file_manager access, we must now list all the extension
|ids| that are allowed to connect to the image loader extension in the
"externally_connectable" permission. The ids are taken from the static
ImageLoader.ALLOWED_CLIENT_ORIGINS list.

Also add 'chrome://file-manager' to ImageLoader.ALLOWED_CLIENT_ORIGINS
list, which is still used to allow (or block) connecting sources based
on their URL origin.

Bug: 1113981, 1123261
Change-Id: I96b0db1a0155510f95285cda8f5c7c62e6fece9b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2600433
Commit-Queue: Noel Gordon <noel@chromium.org>
Reviewed-by: default avatarAlex Danilo <adanilo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#839653}
parent fe61af33
...@@ -83,7 +83,6 @@ function ImageLoader() { ...@@ -83,7 +83,6 @@ function ImageLoader() {
}); });
} }
/** /**
* List of extensions allowed to perform image requests. * List of extensions allowed to perform image requests.
* *
...@@ -94,6 +93,7 @@ ImageLoader.ALLOWED_CLIENT_ORIGINS = [ ...@@ -94,6 +93,7 @@ ImageLoader.ALLOWED_CLIENT_ORIGINS = [
'chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj', // File Manager 'chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj', // File Manager
'chrome-extension://nlkncpkkdoccmpiclbokaimcnedabhhm', // Gallery 'chrome-extension://nlkncpkkdoccmpiclbokaimcnedabhhm', // Gallery
'chrome-extension://jcgeabjmjgoblfofpppfkcoakmfobdko', // Video Player 'chrome-extension://jcgeabjmjgoblfofpppfkcoakmfobdko', // Video Player
'chrome://file-manager', // File Manager SWA
]; ];
/** /**
......
...@@ -20,6 +20,16 @@ ...@@ -20,6 +20,16 @@
"page": "background.html", "page": "background.html",
"persistent": false "persistent": false
}, },
"externally_connectable": {
"ids": [
"hhaomjibdihmijegdhdafkllkbggdgoj", // File Manager
"nlkncpkkdoccmpiclbokaimcnedabhhm", // Gallery
"jcgeabjmjgoblfofpppfkcoakmfobdko" // Video Player
],
"matches": [
"chrome://file-manager/*" // File Manager SWA
]
},
"natively_connectable": ["com.google.holding_space_thumbnail_loader"], "natively_connectable": ["com.google.holding_space_thumbnail_loader"],
"web_accessible_resources": ["image_loader_client.js"] "web_accessible_resources": ["image_loader_client.js"]
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment