Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
browser(firefox): rely on upstream permission separation per contexts (#2613)
Andrey Lushnikov082bb3c3c495
diff --git a/browser_patches/firefox/BUILD_NUMBER b/browser_patches/firefox/BUILD_NUMBERindex 5f2f16bfff..ecdb865e10 100644--- a/browser_patches/firefox/BUILD_NUMBER+++ b/browser_patches/firefox/BUILD_NUMBER@@ -1 +1 @@-1111+1112diff --git a/browser_patches/firefox/patches/bootstrap.diff b/browser_patches/firefox/patches/bootstrap.diffindex bff2ecd49d..1ad82d874d 100644--- a/browser_patches/firefox/patches/bootstrap.diff+++ b/browser_patches/firefox/patches/bootstrap.diff@@ -1121,41 +1121,6 @@ index 82d04ec3a72f3390a43c98eb2ae91f0d15a83631..b197bb0718ed712af2a7c08d2ef691devoid UpdateLanguages(const nsTArray<nsString>& aLanguages);void UpdateJSWorkerMemoryParameter(JSGCParamKey key, Maybe<uint32_t> value);-diff --git a/extensions/permissions/Permission.cpp b/extensions/permissions/Permission.cpp-index 72ed1de82fd322ba2cafffbad5622e2fdb6aa677..0dd907ff05d1df313dd3b8f8561c4ab3296e2931 100644---- a/extensions/permissions/Permission.cpp-+++ b/extensions/permissions/Permission.cpp-@@ -34,7 +34,7 @@ already_AddRefed<nsIPrincipal> Permission::ClonePrincipalForPermission(-- mozilla::OriginAttributes attrs = aPrincipal->OriginAttributesRef();- if (!StaticPrefs::permissions_isolateBy_userContext()) {-- attrs.StripAttributes(mozilla::OriginAttributes::STRIP_USER_CONTEXT_ID);-+ // attrs.StripAttributes(mozilla::OriginAttributes::STRIP_USER_CONTEXT_ID);- }-- nsAutoCString originNoSuffix;-diff --git a/extensions/permissions/PermissionManager.cpp b/extensions/permissions/PermissionManager.cpp-index 36665fad7de7c26c9f7ccce96448868524c5a330..2af744c0c6a7739c702ba6a770a04595292d8356 100644---- a/extensions/permissions/PermissionManager.cpp-+++ b/extensions/permissions/PermissionManager.cpp-@@ -195,7 +195,7 @@ void MaybeStripOAs(bool aForceStrip, OriginAttributes& aOriginAttributes) {- }-- if (flags != 0) {-- aOriginAttributes.StripAttributes(flags);-+ // aOriginAttributes.StripAttributes(flags);- }- }--@@ -228,6 +228,8 @@ nsresult GetOriginFromPrincipal(nsIPrincipal* aPrincipal, bool aForceStripOA,-- OriginAppendOASuffix(attrs, aForceStripOA, aOrigin);--+ // Disable userContext for permissions.-+ // attrs.StripAttributes(mozilla::OriginAttributes::STRIP_USER_CONTEXT_ID);- return NS_OK;- }-diff --git a/js/public/Date.h b/js/public/Date.hindex e7a54d86c44499a3ec2adf1c156b9f9dfb0bc6b4..f56c1b419c4cb52bc371f6b8dbfffba464326fc4 100644--- a/js/public/Date.hdiff --git a/browser_patches/firefox/preferences/playwright.cfg b/browser_patches/firefox/preferences/playwright.cfgindex 3b3c19e34e..d28fd7da1b 100644--- a/browser_patches/firefox/preferences/playwright.cfg+++ b/browser_patches/firefox/preferences/playwright.cfg@@ -13,6 +13,9 @@ pref("dom.ipc.processCount", 60000);// Do not use system colors - they are affected by themes.pref("ui.use_standins_for_native_colors", true);+// Isolate permissions by user context.+pref("permissions.isolateBy.userContext", true);+pref("dom.push.serverURL", "");pref("services.settings.server", "");pref("browser.safebrowsing.provider.mozilla.updateURL", "");