Commit 28d638b0 authored by Eugene But's avatar Eugene But Committed by Commit Bot

Update AppLauncherTabHelper to treat blob URLs as non-app URLs.

From https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL:
The URL.createObjectURL() static method creates a DOMString containing a
URL representing the object given in the parameter. The URL lifetime is
tied to the document in the window on which it was created. The new
object URL represents the specified File object or Blob object.

These URLs have blob: scheme.

Bug: None
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: I6da3069663e735ce89977b15cfee7933a3c20ea1
Reviewed-on: https://chromium-review.googlesource.com/1250163Reviewed-by: default avatarMohammad Refaat <mrefaat@chromium.org>
Commit-Queue: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595147}
parent ba941dcb
......@@ -100,7 +100,8 @@ AppLauncherTabHelper::~AppLauncherTabHelper() = default;
bool AppLauncherTabHelper::IsAppUrl(const GURL& url) {
return !(web::UrlHasWebScheme(url) ||
web::GetWebClient()->IsAppSpecificURL(url) ||
url.SchemeIs(url::kFileScheme) || url.SchemeIs(url::kAboutScheme));
url.SchemeIs(url::kFileScheme) || url.SchemeIs(url::kAboutScheme) ||
url.SchemeIs(url::kBlobScheme));
}
bool AppLauncherTabHelper::RequestToLaunchApp(const GURL& url,
......
......@@ -277,6 +277,9 @@ TEST_F(AppLauncherTabHelperTest, ShouldAllowRequestWithNonAppUrl) {
EXPECT_TRUE(TestShouldAllowRequest(@"data://test",
/*target_frame_is_main=*/false,
/*has_user_gesture=*/true));
EXPECT_TRUE(TestShouldAllowRequest(@"blob://test",
/*target_frame_is_main=*/false,
/*has_user_gesture=*/true));
EXPECT_EQ(0U, delegate_.countOfAppsLaunched);
}
......
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