Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

browser(firefox): disable enterprise policies (#8388)

Joel Einbinder744a2751de37
diff --git a/browser_patches/firefox-beta/BUILD_NUMBER b/browser_patches/firefox-beta/BUILD_NUMBER
index 7bd3ed058b..b0777bbad0 100644
--- a/browser_patches/firefox-beta/BUILD_NUMBER
+++ b/browser_patches/firefox-beta/BUILD_NUMBER
@@ -1,2 +1,2 @@
-1280
-Changed: [email protected] Wed Aug 18 14:34:33 PDT 2021
+1281
+Changed: [email protected] Tue 24 Aug 2021 12:02:01 PM PDT
diff --git a/browser_patches/firefox-beta/patches/bootstrap.diff b/browser_patches/firefox-beta/patches/bootstrap.diff
index 5a4af0378a..6fa3e240a4 100644
--- a/browser_patches/firefox-beta/patches/bootstrap.diff
+++ b/browser_patches/firefox-beta/patches/bootstrap.diff
@@ -2187,6 +2187,23 @@ index 1e9bea1655af731fc003f8d0cab3ad4d2ad29f5d..5081c0e1ee0c41c6a79bd2ed358a5744
// Prevents new window animations on MacOS and Windows. Currently
// ignored for Linux.
const unsigned long CHROME_SUPPRESS_ANIMATION = 0x01000000;
+diff --git a/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.jsm b/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.jsm
+index 733782457c8e654fc2431df874439e24fe7bd4f0..9bdd6dccd1e907c0776e3bd01bb0659d35218787 100644
+--- a/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.jsm
++++ b/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.jsm
+@@ -115,6 +115,12 @@ EnterprisePoliciesManager.prototype = {
+ Services.prefs.clearUserPref(PREF_POLICIES_APPLIED);
+ }
+
++ // Playwright: Disable enterprise policies
++ if (true) {
++ this.status = Ci.nsIEnterprisePolicies.INACTIVE;
++ return;
++ }
++
+ let provider = this._chooseProvider();
+
+ if (provider.failed) {
diff --git a/toolkit/components/startup/nsAppStartup.cpp b/toolkit/components/startup/nsAppStartup.cpp
index 023a2b06931b4c25963a0126ec830e460dc23559..160d521fa17dba14829686da5aa95490eedfda47 100644
--- a/toolkit/components/startup/nsAppStartup.cpp
diff --git a/browser_patches/firefox/BUILD_NUMBER b/browser_patches/firefox/BUILD_NUMBER
index ce211723cb..e165966fec 100644
--- a/browser_patches/firefox/BUILD_NUMBER
+++ b/browser_patches/firefox/BUILD_NUMBER
@@ -1,2 +1,2 @@
-1285
-Changed: [email protected] Wed Aug 18 14:34:33 PDT 2021
+1286
+Changed: [email protected] Mon 23 Aug 2021 08:45:33 PM PDT
diff --git a/browser_patches/firefox/patches/bootstrap.diff b/browser_patches/firefox/patches/bootstrap.diff
index 9887ea5684..364a7b80e9 100644
--- a/browser_patches/firefox/patches/bootstrap.diff
+++ b/browser_patches/firefox/patches/bootstrap.diff
@@ -2187,6 +2187,23 @@ index 1e9bea1655af731fc003f8d0cab3ad4d2ad29f5d..5081c0e1ee0c41c6a79bd2ed358a5744
// Prevents new window animations on MacOS and Windows. Currently
// ignored for Linux.
const unsigned long CHROME_SUPPRESS_ANIMATION = 0x01000000;
+diff --git a/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.jsm b/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.jsm
+index 775144e8a6496fa3b938f111e3b078d2a01fedab..1dd5927fc7106aaf3563fc8e8d88288b3507a9d7 100644
+--- a/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.jsm
++++ b/toolkit/components/enterprisepolicies/EnterprisePoliciesParent.jsm
+@@ -115,6 +115,12 @@ EnterprisePoliciesManager.prototype = {
+ Services.prefs.clearUserPref(PREF_POLICIES_APPLIED);
+ }
+
++ // Playwright: Disable enterprise policies
++ if (true) {
++ this.status = Ci.nsIEnterprisePolicies.INACTIVE;
++ return;
++ }
++
+ let provider = this._chooseProvider();
+
+ if (provider.failed) {
diff --git a/toolkit/components/startup/nsAppStartup.cpp b/toolkit/components/startup/nsAppStartup.cpp
index fb42e6cfc5ee21454ab4b5692575c0161f633f78..80d64aea17f78b46223dce3310831524021d779e 100644
--- a/toolkit/components/startup/nsAppStartup.cpp