Commit 3f593a43 authored by Rachel Carpenter's avatar Rachel Carpenter Committed by Commit Bot

Grant common permissions to untrusted context.

These need to be granted to each app individually while investigation
into granting these to all SWAs is ongoing.

Bug: b/163422374
Change-Id: I533aadc2f76674a20032c212e67abd03bdddda23
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2371385
Commit-Queue: Rachel Carpenter <carpenterr@chromium.org>
Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801185}
parent 0212bf00
......@@ -63,14 +63,19 @@ HelpAppUI::HelpAppUI(content::WebUI* web_ui,
// Add ability to request chrome-untrusted: URLs.
web_ui->AddRequestableScheme(content::kChromeUIUntrustedScheme);
// Always grant the cookies permission. Denying cookies permission causes
// IndexDB and other types of storage to stop working. Given that this is an
// app that is part of Chrome OS, it makes sense to enable the cookies.
// Register common permissions for chrome-untrusted:// pages.
// TODO(https://crbug.com/1113568): Remove this after common permissions are
// granted by default.
auto* permissions_allowlist = WebUIAllowlist::GetOrCreate(browser_context);
const url::Origin untrusted_origin =
url::Origin::Create(GURL(kChromeUIHelpAppUntrustedURL));
permissions_allowlist->RegisterAutoGrantedPermission(
untrusted_origin, ContentSettingsType::COOKIES);
permissions_allowlist->RegisterAutoGrantedPermissions(
untrusted_origin, {
ContentSettingsType::COOKIES,
ContentSettingsType::IMAGES,
ContentSettingsType::JAVASCRIPT,
ContentSettingsType::SOUND,
});
}
HelpAppUI::~HelpAppUI() = default;
......
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