diff --git a/browser/brave_content_browser_client.cc b/browser/brave_content_browser_client.cc index 0da3dabb1fa7..de5dde641da1 100644 --- a/browser/brave_content_browser_client.cc +++ b/browser/brave_content_browser_client.cc @@ -99,9 +99,11 @@ bool BraveContentBrowserClient::AllowAccessCookie(const GURL& url, const GURL& f BraveShieldsWebContentsObserver::GetTabURLFromRenderFrameInfo( render_process_id, render_frame_id).GetOrigin(); ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); - bool allow_brave_shields = brave_shields::IsAllowContentSettingWithIOData( - io_data, tab_origin, tab_origin, CONTENT_SETTINGS_TYPE_PLUGINS, - brave_shields::kBraveShields); + bool allow_brave_shields = + brave_shields::IsAllowContentSettingWithIOData( + io_data, tab_origin, tab_origin, CONTENT_SETTINGS_TYPE_PLUGINS, + brave_shields::kBraveShields) && + !first_party.SchemeIs(kChromeExtensionScheme); bool allow_1p_cookies = brave_shields::IsAllowContentSettingWithIOData( io_data, tab_origin, GURL("https://firstParty/"), CONTENT_SETTINGS_TYPE_PLUGINS, brave_shields::kCookies); diff --git a/browser/extensions/brave_extension_functional_test.cc b/browser/extensions/brave_extension_functional_test.cc index 0c8bd8bbc8d5..7d1d88ef0866 100644 --- a/browser/extensions/brave_extension_functional_test.cc +++ b/browser/extensions/brave_extension_functional_test.cc @@ -15,7 +15,8 @@ namespace extensions { -void ExtensionFunctionalTest::InstallExtensionSilently(ExtensionService* service, +const Extension* ExtensionFunctionalTest::InstallExtensionSilently( + ExtensionService* service, const base::FilePath& path) { ExtensionRegistry* registry = ExtensionRegistry::Get(profile()); size_t num_before = registry->enabled_extensions().size(); @@ -39,6 +40,7 @@ void ExtensionFunctionalTest::InstallExtensionSilently(ExtensionService* service const Extension* extension = registry_observer.WaitForExtensionReady(); EXPECT_TRUE(extension); + return extension; } void ExtensionFunctionalTest::SetUp() { diff --git a/browser/extensions/brave_extension_functional_test.h b/browser/extensions/brave_extension_functional_test.h index 041cae2a0553..8ec903be90cd 100644 --- a/browser/extensions/brave_extension_functional_test.h +++ b/browser/extensions/brave_extension_functional_test.h @@ -10,8 +10,8 @@ namespace extensions { class ExtensionFunctionalTest : public ExtensionBrowserTest { public: - void InstallExtensionSilently(ExtensionService* service, - const base::FilePath& path); + const Extension* InstallExtensionSilently(ExtensionService* service, + const base::FilePath& path); void SetUp() override; void InitEmbeddedTestServer(); void GetTestDataDir(base::FilePath* test_data_dir); diff --git a/browser/extensions/brave_extension_provider_browsertest.cc b/browser/extensions/brave_extension_provider_browsertest.cc index c03e555ae204..42c9c993c5c7 100644 --- a/browser/extensions/brave_extension_provider_browsertest.cc +++ b/browser/extensions/brave_extension_provider_browsertest.cc @@ -8,6 +8,8 @@ #include "brave/browser/brave_browser_process_impl.h" #include "brave/browser/extensions/brave_extension_functional_test.h" #include "brave/common/brave_paths.h" +#include "brave/common/pref_names.h" +#include "brave/common/url_constants.h" #include "brave/components/brave_shields/browser/https_everywhere_service.h" #include "chrome/browser/extensions/crx_installer.h" #include "chrome/browser/extensions/extension_browsertest.h" @@ -65,4 +67,68 @@ IN_PROC_BROWSER_TEST_F(BraveExtensionProviderTest, PDFJSInstalls) { ASSERT_TRUE(pdfjs_exists); } +// Load an extension page with an ad image, and make sure it is NOT blocked. +// It would otherwise be blocked though if it wasn't an extension. +IN_PROC_BROWSER_TEST_F(BraveExtensionProviderTest, AdsNotBlockedByDefaultBlockerInExtension) { + base::FilePath test_data_dir; + GetTestDataDir(&test_data_dir); + const extensions::Extension* extension = InstallExtensionSilently(extension_service(), + test_data_dir.AppendASCII("extension-compat-test-extension.crx")); + GURL url = GURL(std::string(kChromeExtensionScheme) + "://" + extension->id() + "/blocking.html"); + + ui_test_utils::NavigateToURL(browser(), url); + content::WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); + ASSERT_TRUE(content::WaitForLoadStop(contents)); + EXPECT_EQ(url, contents->GetURL()); + + bool as_expected = false; + ASSERT_TRUE(ExecuteScriptAndExtractBool( + contents, + "setExpectations(1, 0, 0, 0);" + "addImage('ad_banner.png')", + &as_expected)); + EXPECT_TRUE(as_expected); + EXPECT_EQ(browser()->profile()->GetPrefs()->GetUint64(kAdsBlocked), 0ULL); +} + +IN_PROC_BROWSER_TEST_F(BraveExtensionProviderTest, ExtensionsCanGetCookies) { + base::FilePath test_data_dir; + GetTestDataDir(&test_data_dir); + const extensions::Extension* extension = InstallExtensionSilently(extension_service(), + test_data_dir.AppendASCII("extension-compat-test-extension.crx")); + GURL url = GURL(std::string(kChromeExtensionScheme) + "://" + extension->id() + "/blocking.html"); + + ui_test_utils::NavigateToURL(browser(), url); + content::WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); + ASSERT_TRUE(content::WaitForLoadStop(contents)); + EXPECT_EQ(url, contents->GetURL()); + + bool as_expected = false; + ASSERT_TRUE(ExecuteScriptAndExtractBool( + contents, + "canGetCookie('test', 'http://a.com')", + &as_expected)); + EXPECT_TRUE(as_expected); +} + +IN_PROC_BROWSER_TEST_F(BraveExtensionProviderTest, ExtensionsCanSetCookies) { + base::FilePath test_data_dir; + GetTestDataDir(&test_data_dir); + const extensions::Extension* extension = InstallExtensionSilently(extension_service(), + test_data_dir.AppendASCII("extension-compat-test-extension.crx")); + GURL url = GURL(std::string(kChromeExtensionScheme) + "://" + extension->id() + "/blocking.html"); + + ui_test_utils::NavigateToURL(browser(), url); + content::WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); + ASSERT_TRUE(content::WaitForLoadStop(contents)); + EXPECT_EQ(url, contents->GetURL()); + + bool as_expected = false; + ASSERT_TRUE(ExecuteScriptAndExtractBool( + contents, + "canSetCookie('test', 'testval', 'http://a.com')", + &as_expected)); + EXPECT_TRUE(as_expected); +} + } // namespace extnesions diff --git a/browser/net/brave_ad_block_tp_network_delegate_helper.cc b/browser/net/brave_ad_block_tp_network_delegate_helper.cc index ce509b7ad8eb..32376c014294 100644 --- a/browser/net/brave_ad_block_tp_network_delegate_helper.cc +++ b/browser/net/brave_ad_block_tp_network_delegate_helper.cc @@ -11,7 +11,6 @@ #include "brave/browser/brave_browser_process_impl.h" #include "brave/common/network_constants.h" #include "brave/common/shield_exceptions.h" -#include "brave/common/url_util.h" #include "brave/components/brave_shields/browser/ad_block_regional_service.h" #include "brave/components/brave_shields/browser/ad_block_service.h" #include "brave/components/brave_shields/browser/brave_shields_util.h" @@ -99,12 +98,7 @@ void OnBeforeURLRequestAdBlockTPOnTaskRunner(std::shared_ptr c } DCHECK(ctx->request_identifier != 0); - // For PDFJS we don't want to treat 2 different URLs as 3p for the main pdf - // load which is meant to be top level - // chrome-extension://oemmndcbldboiebfnladdacbdfmadadm/https://developer.att.com/.../file.pdf - // https://developer.att.com/.../file.pdf - // So if the tab origin is chrome-extension, set it to that of the PDF only for PDFJS - std::string tab_host = brave::GetURLOrPDFURL(ctx->tab_url).host(); + std::string tab_host = ctx->tab_origin.host(); if (!g_brave_browser_process->tracking_protection_service()-> ShouldStartRequest(ctx->request_url, ctx->resource_type, tab_host)) { ctx->new_url_spec = GetBlankDataURLForResourceType(ctx->resource_type).spec(); diff --git a/browser/net/brave_site_hacks_network_delegate_helper.cc b/browser/net/brave_site_hacks_network_delegate_helper.cc index 4f96970c495a..fb59bc399f8b 100644 --- a/browser/net/brave_site_hacks_network_delegate_helper.cc +++ b/browser/net/brave_site_hacks_network_delegate_helper.cc @@ -10,6 +10,7 @@ #include "base/strings/string_util.h" #include "brave/common/network_constants.h" #include "brave/common/shield_exceptions.h" +#include "brave/common/url_constants.h" #include "brave/components/brave_shields/browser/brave_shields_util.h" #include "brave/components/brave_shields/browser/brave_shields_web_contents_observer.h" #include "brave/components/brave_shields/common/brave_shield_constants.h" @@ -28,6 +29,9 @@ bool ApplyPotentialReferrerBlock(net::URLRequest* request) { DCHECK_CURRENTLY_ON(BrowserThread::IO); GURL target_origin = GURL(request->url()).GetOrigin(); GURL tab_origin = request->site_for_cookies().GetOrigin(); + if (tab_origin.SchemeIs(kChromeExtensionScheme)) { + return false; + } bool allow_referrers = brave_shields::IsAllowContentSettingFromIO( request, tab_origin, tab_origin, CONTENT_SETTINGS_TYPE_PLUGINS, brave_shields::kReferrers); diff --git a/browser/net/brave_site_hacks_network_delegate_helper_unittest.cc b/browser/net/brave_site_hacks_network_delegate_helper_unittest.cc index 5304fc6cda56..ceb9695faa98 100644 --- a/browser/net/brave_site_hacks_network_delegate_helper_unittest.cc +++ b/browser/net/brave_site_hacks_network_delegate_helper_unittest.cc @@ -271,4 +271,32 @@ TEST_F(BraveSiteHacksNetworkDelegateHelperTest, ReferrerCleared) { }); } +TEST_F(BraveSiteHacksNetworkDelegateHelperTest, ReferrerWouldBeClearedButExtensionSite) { + std::vector urls({ + GURL("https://digg.com/7"), + GURL("https://slashdot.org/5"), + GURL("https://bondy.brian.org") + }); + std::for_each(urls.begin(), urls.end(), + [this](GURL url){ + net::TestDelegate test_delegate; + std::unique_ptr request = + context()->CreateRequest(url, net::IDLE, &test_delegate, + TRAFFIC_ANNOTATION_FOR_TESTS); + request->set_site_for_cookies(GURL("chrome-extension://aemmndcbldboiebfnladdacbdfmadadm/test.html")); + std::string original_referrer = "https://hello.brianbondy.com/about"; + request->SetReferrer(original_referrer); + + std::shared_ptr + brave_request_info(new brave::BraveRequestInfo()); + brave::BraveRequestInfo::FillCTXFromRequest(request.get(), brave_request_info); + brave::ResponseCallback callback; + int ret = brave::OnBeforeURLRequest_SiteHacksWork(callback, brave_request_info); + EXPECT_EQ(ret, net::OK); + // new_url should not be set + EXPECT_TRUE(brave_request_info->new_url_spec.empty()); + EXPECT_STREQ(request->referrer().c_str(), original_referrer.c_str()); + }); +} + } // namespace diff --git a/browser/net/url_context.cc b/browser/net/url_context.cc index 79afcf8c0847..029c873fc8e9 100644 --- a/browser/net/url_context.cc +++ b/browser/net/url_context.cc @@ -7,6 +7,7 @@ #include +#include "brave/common/url_constants.h" #include "brave/components/brave_shields/browser/brave_shields_util.h" #include "brave/components/brave_shields/common/brave_shield_constants.h" #include "content/public/browser/resource_request_info.h" @@ -23,7 +24,6 @@ void BraveRequestInfo::FillCTXFromRequest(const net::URLRequest* request, std::shared_ptr ctx) { ctx->request_identifier = request->identifier(); ctx->request_url = request->url(); - ctx->tab_url = request->site_for_cookies(); ctx->tab_origin = request->site_for_cookies().GetOrigin(); auto* request_info = content::ResourceRequestInfo::ForRequest(request); if (request_info) { @@ -33,7 +33,8 @@ void BraveRequestInfo::FillCTXFromRequest(const net::URLRequest* request, &ctx->frame_tree_node_id); ctx->allow_brave_shields = brave_shields::IsAllowContentSettingFromIO( request, ctx->tab_origin, ctx->tab_origin, CONTENT_SETTINGS_TYPE_PLUGINS, - brave_shields::kBraveShields); + brave_shields::kBraveShields) && + !request->site_for_cookies().SchemeIs(kChromeExtensionScheme); ctx->allow_ads = brave_shields::IsAllowContentSettingFromIO( request, ctx->tab_origin, ctx->tab_origin, CONTENT_SETTINGS_TYPE_PLUGINS, brave_shields::kAds); diff --git a/browser/net/url_context.h b/browser/net/url_context.h index ebee381a407f..ec71bfd80d3a 100644 --- a/browser/net/url_context.h +++ b/browser/net/url_context.h @@ -51,7 +51,6 @@ struct BraveRequestInfo { ~BraveRequestInfo(); GURL request_url; GURL tab_origin; - GURL tab_url; std::string new_url_spec; bool allow_brave_shields = true; bool allow_ads = false; diff --git a/common/BUILD.gn b/common/BUILD.gn index 41f5583ec44b..fa673a7148ca 100644 --- a/common/BUILD.gn +++ b/common/BUILD.gn @@ -51,8 +51,6 @@ source_set("common") { "shield_exceptions.h", "url_constants.cc", "url_constants.h", - "url_util.cc", - "url_util.h", ] public_deps = [ diff --git a/common/url_constants.cc b/common/url_constants.cc index 90018b6d32e8..cf5b7a0a0423 100644 --- a/common/url_constants.cc +++ b/common/url_constants.cc @@ -4,6 +4,7 @@ #include "brave/common/url_constants.h" +const char kChromeExtensionScheme[] = "chrome-extension"; const char kBraveUIScheme[] = "brave"; const char kMagnetScheme[] = "magnet"; const char kWidevineMoreInfoURL[] = "https://www.eff.org/issues/drm"; diff --git a/common/url_constants.h b/common/url_constants.h index fca2e0bd02a4..771a74b4cbfa 100644 --- a/common/url_constants.h +++ b/common/url_constants.h @@ -5,6 +5,7 @@ #ifndef BRAVE_COMMON_URL_CONSTANTS_H_ #define BRAVE_COMMON_URL_CONSTANTS_H_ +extern const char kChromeExtensionScheme[]; extern const char kBraveUIScheme[]; extern const char kMagnetScheme[]; extern const char kWidevineMoreInfoURL[]; diff --git a/common/url_util.cc b/common/url_util.cc deleted file mode 100644 index 9609f687998f..000000000000 --- a/common/url_util.cc +++ /dev/null @@ -1,28 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "brave/common/url_util.h" - -#include - -#include "brave/common/extensions/extension_constants.h" -#include "url/gurl.h" - -namespace brave { - -GURL GetURLOrPDFURL(const GURL& url) { - if (url.SchemeIs("chrome-extension") && - url.host() == pdfjs_extension_id) { - static size_t pdfjs_substring_len = std::string(pdfjs_extension_origin).length(); - size_t http_pos = url.spec().find(std::string(pdfjs_extension_origin) + "http://"); - size_t https_pos = url.spec().find(std::string(pdfjs_extension_origin) + "https://"); - if (http_pos != std::string::npos || https_pos != std::string::npos) { - return GURL(url.spec().substr(pdfjs_substring_len, - url.spec().length() - pdfjs_substring_len)); - } - } - return url; -} - -} // namespace brave diff --git a/common/url_util.h b/common/url_util.h deleted file mode 100644 index 2f8a15ab5eda..000000000000 --- a/common/url_util.h +++ /dev/null @@ -1,18 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef BRAVE_COMMON_URL_UTIL_H_ -#define BRAVE_COMMON_URL_UTIL_H_ - -class GURL; - -namespace brave { - -// Returns the location of the PDF if this URL is a PDFJS extension URL. -// Otherwise simply just returns the same URL as passed in. -GURL GetURLOrPDFURL(const GURL& url); - -} // namespace brave - -#endif // BRAVE_COMMON_URL_UTIL_H_ diff --git a/common/url_util_unittest.cc b/common/url_util_unittest.cc deleted file mode 100644 index 673ab9c24e3b..000000000000 --- a/common/url_util_unittest.cc +++ /dev/null @@ -1,34 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "brave/common/url_util.h" -#include "chrome/test/base/chrome_render_view_host_test_harness.h" -#include "url/gurl.h" - -typedef testing::Test BraveUrlUtilTest; - -namespace brave { - -TEST_F(BraveUrlUtilTest, GetURLOrPDFURL) { - std::vector unchanged_urls({ - // PDFJS URL but not to a PDF - GURL("chrome-extension://oemmndcbldboiebfnladdacbdfmadadm/test.html"), - // PDFJS ID but not chrome-extension scheme - GURL("chrome://oemmndcbldboiebfnladdacbdfmadadm/https://test.html"), - // Not PDFJS ID but format of a PDFJS PDF URL - GURL("chrome-extension://aaamndcbldboiebfnladdacbdfmadaaa/https://example.com/test.html"), - // Random other URL - GURL("https://example.com") - }); - std::for_each(unchanged_urls.begin(), unchanged_urls.end(), - [this](GURL url){ - EXPECT_EQ(brave::GetURLOrPDFURL(url), url); - }); - EXPECT_EQ(brave::GetURLOrPDFURL(GURL("chrome-extension://oemmndcbldboiebfnladdacbdfmadadm/http://example.com?test")), - GURL("http://example.com?test")); - EXPECT_EQ(brave::GetURLOrPDFURL(GURL("chrome-extension://oemmndcbldboiebfnladdacbdfmadadm/https://example.com?test")), - GURL("https://example.com?test")); -} - -} // namespace diff --git a/components/content_settings/core/browser/brave_cookie_settings.cc b/components/content_settings/core/browser/brave_cookie_settings.cc index 0b14113f4331..cbd330fb0a5e 100644 --- a/components/content_settings/core/browser/brave_cookie_settings.cc +++ b/components/content_settings/core/browser/brave_cookie_settings.cc @@ -6,6 +6,7 @@ #include "brave/components/brave_shields/common/brave_shield_constants.h" #include "brave/common/brave_cookie_blocking.h" +#include "extensions/buildflags/buildflags.h" #include "net/base/registry_controlled_domains/registry_controlled_domain.h" #include "url/gurl.h" @@ -36,6 +37,24 @@ void BraveCookieSettings::GetCookieSetting(const GURL& url, content_settings::SettingSource* source, ContentSetting* cookie_setting) const { DCHECK(cookie_setting); + + // Auto-allow in extensions or for WebUI embedded in a secure origin. + // This matches an early return case in CookieSettings::GetCookieSetting + if (first_party_url.SchemeIs(kChromeUIScheme) && + url.SchemeIsCryptographic()) { + *cookie_setting = CONTENT_SETTING_ALLOW; + return; + } + + // This matches an early return case in CookieSettings::GetCookieSetting +#if BUILDFLAG(ENABLE_EXTENSIONS) + if (url.SchemeIs(extension_scheme_) && + first_party_url.SchemeIs(extension_scheme_)) { + *cookie_setting = CONTENT_SETTING_ALLOW; + return; + } +#endif + CookieSettings::GetCookieSetting(url, first_party_url, source, cookie_setting); if (*cookie_setting == CONTENT_SETTING_BLOCK) { diff --git a/test/BUILD.gn b/test/BUILD.gn index 60fd688f9a26..20cd38be8f85 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -59,7 +59,6 @@ test("brave_unit_tests") { "//brave/common/shield_exceptions_unittest.cc", "//brave/common/tor/tor_test_constants.cc", "//brave/common/tor/tor_test_constants.h", - "//brave/common/url_util_unittest.cc", "//brave/components/assist_ranker/ranker_model_loader_impl_unittest.cc", "//brave/components/brave_shields/browser/ad_block_regional_service_unittest.cc", "//brave/components/brave_sync/bookmark_order_util_unittest.cc", diff --git a/test/data/extension-compat-test-extension.crx b/test/data/extension-compat-test-extension.crx new file mode 100644 index 000000000000..3cd46f5f6f6c Binary files /dev/null and b/test/data/extension-compat-test-extension.crx differ diff --git a/test/data/extension-compat-test-extension.pem b/test/data/extension-compat-test-extension.pem new file mode 100644 index 000000000000..760a8ca83057 --- /dev/null +++ b/test/data/extension-compat-test-extension.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC7TSAG1CeeGqb3 +0m4ZOk5SGNA5xI1wDpnJzMa5auxjGIYqiHt7EgSeJeA7oGj0fHblqawaOJ9aLuTX +r6GS/UD8xK0MjBqX26g5U81sGx18ZqgoJ6XdOwbj8B4lRG5IMI32yoagCFLAdxmk +NZTQeYLtNdNlYm/WkZZfOy8in6Kta/FUqHbSPrnum5NzMwG30R45Whj2iOINk1P4 +ibIlDtjBYhEH10gZ1yx2fJS2vL7akgReiWuFkb2eH9IVodHP3Tr04griZVO5Xk5M +CABAnNZIYY8/GhpwN9LcSu/NtxL0RmS9anAG1quJP4LR3ycj/YQ4HTZ7axbH0Syu +b9/DWIlZAgMBAAECggEAKychjBk4mHtdASdlEOBnV5BadxjDGnBuu7j3hxQsqscl +cCq6QlhcIoCo+SvjyoJblV3CZlcp1aoMtOnE0NwS6zm4AfZMkTS9PRoC79eOc1Em +iHvcAcy98Wmq1FzACNdQ+e1e14ObZzb5fCURKHf6c4MNdaQYjsfDrKSy3ygG36vj +/oUEk/7KTBn7L39B0kS0C15S04+T9F2n16/RV+wf+4TRM0mkcJ1rUypVnolyE49Y +16iyBbSphm0YfJCqe/yZS0Yw5CS+JqYec7aoVMjJmm6QcC7ss8ZoYVhJChMc7Qml +EcD21W/hS8g+Irv4j45lJW0CzwpVIN2NPmOh/e+h5QKBgQDsgpSecL8qT0wsk0kU +/tvgcA2TNFVShfHXEBjqC47cT0uYhOHVMIErwsT0ANvS/njcdsHs0vBA5b/Celo9 +nzGV3KNuzYvZZC7Y427KYFcDLJ1PLT5kenDiibTffkwY0FtXoEYZvefdLOzBlyTB +EpVRYMEdxXiuH5c7ExQjvNpl3QKBgQDKvG9WpRkZoSDH14sgdFWTXxB5kf4yN68v +ATmswI++IIPBcZiHu0B2jRv2vVznP3/dEorGCijRdiLh1uXAKt7ik/uepgujDyvn +qu5YvV2eMJaOT314od8qAYYkJBALxCQeQsJWsYenwbtLFjKn9g09FJ9DEP+iezWJ +uk1n3LTPrQKBgQCSLoejgnZ1tTuU1Zg3NOs8RqXtVUxjTEzVK6rqhihPvWcxJvja +pzc/kAvh8OHuAME9Kt3j/eDni9nBX5SFP+8K/Ku7YapNvKFEBxbEWVWOrbWxaXqF +6jP5oTm9ZbetIqNCftq1MG6ugwT3Bu99snm+KbpTJ2nW3cnAhqNND35BtQKBgBDO +iEhdjXQjeG04wC7jlgiOk/YQFUuidCJobpiUqhXv6hxKR4PRESoCzrOoxR/ikr4I +AHskcnfS3FdukkNZCnssG2ruhv5wjoo5EGNI547qpkCL9HHgsXhxAebTGoVvMDNW +A3heZUmR9O3nnDFyY2yR3hYYPakBn9GYITyf/llNAoGBAJrcAZUlYcSifEjnddrX ++IsSlmOFWiWSdrJ/G2dnZoO2OG93tCvCDcOfmALSeULoNWGoDWKdb/kGEN6vZz3y +Cp09b4V6/3zzeC28iTcHDXCYr+WPrgyElaNYA6BXCmK0O+9GHY53ZTLHiCFL4jUm +IKfRKkHbxak0UPLRIBCd3n1+ +-----END PRIVATE KEY----- diff --git a/test/data/extension-compat-test-extension/README.md b/test/data/extension-compat-test-extension/README.md new file mode 100644 index 000000000000..cafd77ef0f7b --- /dev/null +++ b/test/data/extension-compat-test-extension/README.md @@ -0,0 +1 @@ +This is an extension like any other but for the purpose to test that shields do not take effect in extensions in general. diff --git a/test/data/extension-compat-test-extension/ad_banner.png b/test/data/extension-compat-test-extension/ad_banner.png new file mode 100644 index 000000000000..44ddb41fe95a Binary files /dev/null and b/test/data/extension-compat-test-extension/ad_banner.png differ diff --git a/test/data/extension-compat-test-extension/blocking.html b/test/data/extension-compat-test-extension/blocking.html new file mode 100644 index 000000000000..9389e0ce10a8 --- /dev/null +++ b/test/data/extension-compat-test-extension/blocking.html @@ -0,0 +1,99 @@ + + + + + + + + + diff --git a/test/data/extension-compat-test-extension/manifest.json b/test/data/extension-compat-test-extension/manifest.json new file mode 100644 index 000000000000..188ca273501a --- /dev/null +++ b/test/data/extension-compat-test-extension/manifest.json @@ -0,0 +1,9 @@ +{ + "description": "Extension to test extension compat", + "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnsTdWGAO7gvCgM/ymAuEQ+OpT5T7zGj6UUR/ArzRvdM4RcU97O8Qnq86XSxwKdd/DjqsxGSimU5vw/WS4Xvos7ZnrSKy9oqo1ahPa7IQKnPNbs4OVwuI7HBnuskONveGcSH3LL+Vx5CDYpbjbgQMtOxEX3xO8u/MjAyzkt26XKS1jlsKbwY5yD38IsB9ldBVTU7oHMCA0pJpyQ0J4eKFtb0GdqUlUgpK/KYb+xP30Z81RzHXpdhXNN+jMQV8M9zox7FeWTGoKkE2faZcXn7VP88Gw0i8enZpR9JGD9fSexJ/IW9BzlkjEk8EI6pM309qGxe0ctj20a0MVcZDCLsGaQIDAQAB", + "manifest_version": 2, + "name": "Extension Compat Tester", + "permissions": ["cookies", "http://a.com/"], + "content_security_policy": "default-src 'self'; script-src 'self' 'sha256-dCCnyHXZPS+flQRW+/XLcNgtOt9dxsgyClhYhOSDEMw=';", + "version": "1.0.0" +}