Skip to content

Commit 8a1abfb

Browse files
committed
Disable OOPIFs without disabling COOP #150
1 parent 0fea201 commit 8a1abfb

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
diff --git a/docshell/base/BrowsingContext.cpp b/docshell/base/BrowsingContext.cpp
2+
index 2471976f64..d14edc9195 100644
3+
--- a/docshell/base/BrowsingContext.cpp
4+
+++ b/docshell/base/BrowsingContext.cpp
5+
@@ -83,6 +83,7 @@
6+
#include "nsScriptError.h"
7+
#include "nsThreadUtils.h"
8+
#include "xpcprivate.h"
9+
+#include "MaskConfig.hpp"
10+
11+
#include "AutoplayPolicy.h"
12+
#include "GVAutoplayRequestStatusIPC.h"
13+
@@ -1772,7 +1773,10 @@ NS_IMETHODIMP BrowsingContext::SetRemoteSubframes(bool aUseRemoteSubframes) {
14+
return NS_ERROR_UNEXPECTED;
15+
}
16+
17+
- mUseRemoteSubframes = aUseRemoteSubframes;
18+
+ // Camoufox: Disable remote subframes by default
19+
+ if (MaskConfig::GetBool("enableRemoteSubframes")) {
20+
+ mUseRemoteSubframes = aUseRemoteSubframes;
21+
+ }
22+
return NS_OK;
23+
}
24+
25+
diff --git a/docshell/base/moz.build b/docshell/base/moz.build
26+
index 3520e9d75a..0f73f2dd82 100644
27+
--- a/docshell/base/moz.build
28+
+++ b/docshell/base/moz.build
29+
@@ -124,3 +124,5 @@ LOCAL_INCLUDES += [
30+
EXTRA_JS_MODULES += ["URIFixup.sys.mjs"]
31+
32+
include("/tools/fuzzing/libfuzzer-config.mozbuild")
33+
+
34+
+LOCAL_INCLUDES += ['/camoucfg']
35+
\ No newline at end of file

settings/camoucfg.jvv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@
293293

294294
"allowMainWorld": "bool",
295295
"forceScopeAccess": "bool",
296+
"enableRemoteSubframes": "bool",
296297
"memorysaver": "bool",
297298
"addons": "array[str]",
298299
"debug": "bool"

settings/camoufox.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ defaultPref(
4040

4141
// Tweaks that undo Playwright:
4242

43-
// Force enable content isolation (WAFs can detect this!)
43+
// Enable content isolation (WAFs can detect this!)
4444
defaultPref("fission.autostart", true);
45-
defaultPref("fission.webContentIsolationStrategy", 2);
45+
defaultPref("fission.webContentIsolationStrategy", 1);
4646

4747
// Use dark theme by default
4848
defaultPref("ui.systemUsesDarkTheme", 1);

settings/properties.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
{ "property": "mediaDevices:enabled", "type": "bool" },
9696
{ "property": "allowMainWorld", "type": "bool" },
9797
{ "property": "forceScopeAccess", "type": "bool" },
98+
{ "property": "enableRemoteSubframes", "type": "bool" },
9899
{ "property": "memorysaver", "type": "bool" },
99100
{ "property": "addons", "type": "array" },
100101
{ "property": "debug", "type": "bool" }

0 commit comments

Comments
 (0)