diff --git a/patches/disable-remote-subframes.patch b/patches/disable-remote-subframes.patch new file mode 100644 index 0000000..fd63e9d --- /dev/null +++ b/patches/disable-remote-subframes.patch @@ -0,0 +1,35 @@ +diff --git a/docshell/base/BrowsingContext.cpp b/docshell/base/BrowsingContext.cpp +index 2471976f64..d14edc9195 100644 +--- a/docshell/base/BrowsingContext.cpp ++++ b/docshell/base/BrowsingContext.cpp +@@ -83,6 +83,7 @@ + #include "nsScriptError.h" + #include "nsThreadUtils.h" + #include "xpcprivate.h" ++#include "MaskConfig.hpp" + + #include "AutoplayPolicy.h" + #include "GVAutoplayRequestStatusIPC.h" +@@ -1772,7 +1773,10 @@ NS_IMETHODIMP BrowsingContext::SetRemoteSubframes(bool aUseRemoteSubframes) { + return NS_ERROR_UNEXPECTED; + } + +- mUseRemoteSubframes = aUseRemoteSubframes; ++ // Camoufox: Disable remote subframes by default ++ if (MaskConfig::GetBool("enableRemoteSubframes")) { ++ mUseRemoteSubframes = aUseRemoteSubframes; ++ } + return NS_OK; + } + +diff --git a/docshell/base/moz.build b/docshell/base/moz.build +index 3520e9d75a..0f73f2dd82 100644 +--- a/docshell/base/moz.build ++++ b/docshell/base/moz.build +@@ -124,3 +124,5 @@ LOCAL_INCLUDES += [ + EXTRA_JS_MODULES += ["URIFixup.sys.mjs"] + + include("/tools/fuzzing/libfuzzer-config.mozbuild") ++ ++LOCAL_INCLUDES += ['/camoucfg'] +\ No newline at end of file diff --git a/settings/camoucfg.jvv b/settings/camoucfg.jvv index f87844f..efc255e 100644 --- a/settings/camoucfg.jvv +++ b/settings/camoucfg.jvv @@ -293,6 +293,7 @@ "allowMainWorld": "bool", "forceScopeAccess": "bool", + "enableRemoteSubframes": "bool", "memorysaver": "bool", "addons": "array[str]", "debug": "bool" diff --git a/settings/camoufox.cfg b/settings/camoufox.cfg index b0dd8ae..b8112c6 100644 --- a/settings/camoufox.cfg +++ b/settings/camoufox.cfg @@ -40,9 +40,9 @@ defaultPref( // Tweaks that undo Playwright: -// Force enable content isolation (WAFs can detect this!) +// Enable content isolation (WAFs can detect this!) defaultPref("fission.autostart", true); -defaultPref("fission.webContentIsolationStrategy", 2); +defaultPref("fission.webContentIsolationStrategy", 1); // Use dark theme by default defaultPref("ui.systemUsesDarkTheme", 1); diff --git a/settings/properties.json b/settings/properties.json index f8bd8a2..19ea09a 100644 --- a/settings/properties.json +++ b/settings/properties.json @@ -95,6 +95,7 @@ { "property": "mediaDevices:enabled", "type": "bool" }, { "property": "allowMainWorld", "type": "bool" }, { "property": "forceScopeAccess", "type": "bool" }, + { "property": "enableRemoteSubframes", "type": "bool" }, { "property": "memorysaver", "type": "bool" }, { "property": "addons", "type": "array" }, { "property": "debug", "type": "bool" }