Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion additions/juggler/TargetRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

const {Helper} = ChromeUtils.importESModule('chrome://juggler/content/Helper.js');
const {Preferences} = ChromeUtils.importESModule("resource://gre/modules/Preferences.sys.mjs");
const {ContextualIdentityService} = ChromeUtils.importESModule("resource://gre/modules/ContextualIdentityService.sys.mjs");
const {ContextualIdentityService} = ChromeUtils.importESModule("moz-src:///toolkit/components/contextualidentity/ContextualIdentityService.sys.mjs");
const {NetUtil} = ChromeUtils.importESModule('resource://gre/modules/NetUtil.sys.mjs');
const {AppConstants} = ChromeUtils.importESModule("resource://gre/modules/AppConstants.sys.mjs");
// This module's scope has no timer globals (unlike the content-side juggler
Expand Down Expand Up @@ -57,6 +57,8 @@ const SNAPSHOT_SCREENCAST_FPS = 25;
const ALL_PERMISSIONS = [
'geo',
'desktop-notification',
'local-network',
'loopback-network',
];

let globalTabAndWindowActivationChain = Promise.resolve();
Expand Down
1 change: 1 addition & 0 deletions additions/juggler/components/Juggler.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ ActorManagerParent.addJSWindowActors({
},
},
allFrames: true,
safeForUntrustedWebProcess: true,
},
});

Expand Down
2 changes: 1 addition & 1 deletion additions/juggler/content/FrameTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class FrameTree {
Ci.nsISupportsWeakReference,
]);

this._wdm = Cc["@mozilla.org/dom/workers/workerdebuggermanager;1"].createInstance(Ci.nsIWorkerDebuggerManager);
this._wdm = Cc["@mozilla.org/dom/workers/workerdebuggermanager;1"].getService(Ci.nsIWorkerDebuggerManager);
this._wdmListener = {
QueryInterface: ChromeUtils.generateQI([Ci.nsIWorkerDebuggerManagerListener]),
onRegister: this._onWorkerCreated.bind(this),
Expand Down
45 changes: 26 additions & 19 deletions additions/juggler/content/Runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,28 +543,35 @@ class Runtime {
resolve = a;
reject = b;
});
this._pendingPromises.set(obj.promiseID, {resolve, reject, executionContext, exceptionDetails});
this._pendingPromises.set(obj.promiseID, {resolve, reject, executionContext, exceptionDetails, promiseObj: obj});
// Firefox 156 removed Debugger.onPromiseSettled (bug 2044167). As upstream
// Juggler does, attach reactions inside the debuggee that hit a `debugger;`
// statement when the promise settles, and sweep the pending promises from
// onDebuggerStatement. This also works in workers, which have no Xrays.
if (this._pendingPromises.size === 1)
this._debugger.onPromiseSettled = this._onPromiseSettled.bind(this);
this._debugger.onDebuggerStatement = this._onDebuggerStatement.bind(this);
executionContext._debuggee.executeInGlobalWithBindings(
'p.then(() => { debugger; }, () => { debugger; })', {p: obj}, {useInnerBindings: true});
return await promise;
}

_onPromiseSettled(obj) {
const pendingPromise = this._pendingPromises.get(obj.promiseID);
if (!pendingPromise)
return;
this._pendingPromises.delete(obj.promiseID);
_onDebuggerStatement() {
for (const [promiseID, pendingPromise] of this._pendingPromises) {
const obj = pendingPromise.promiseObj;
if (obj.promiseState === 'pending')
continue;
this._pendingPromises.delete(promiseID);
if (obj.promiseState === 'fulfilled') {
pendingPromise.resolve({success: true, obj: obj.promiseValue});
continue;
}
const debuggee = pendingPromise.executionContext._debuggee;
pendingPromise.exceptionDetails.text = debuggee.executeInGlobalWithBindings('e.message', {e: obj.promiseReason}, {useInnerBindings: true}).return;
pendingPromise.exceptionDetails.stack = debuggee.executeInGlobalWithBindings('e.stack', {e: obj.promiseReason}, {useInnerBindings: true}).return;
pendingPromise.resolve({success: false, obj: null});
}
if (!this._pendingPromises.size)
this._debugger.onPromiseSettled = undefined;

if (obj.promiseState === 'fulfilled') {
pendingPromise.resolve({success: true, obj: obj.promiseValue});
return;
};
const debuggee = pendingPromise.executionContext._debuggee;
pendingPromise.exceptionDetails.text = debuggee.executeInGlobalWithBindings('e.message', {e: obj.promiseReason}, {useInnerBindings: true}).return;
pendingPromise.exceptionDetails.stack = debuggee.executeInGlobalWithBindings('e.stack', {e: obj.promiseReason}, {useInnerBindings: true}).return;
pendingPromise.resolve({success: false, obj: null});
this._debugger.onDebuggerStatement = undefined;
}

createExecutionContext(domWindow, contextGlobal, auxData) {
Expand Down Expand Up @@ -597,7 +604,7 @@ class Runtime {
}
}
if (!this._pendingPromises.size)
this._debugger.onPromiseSettled = undefined;
this._debugger.onDebuggerStatement = undefined;
this._debugger.removeDebuggee(context._contextGlobal);
}

Expand All @@ -613,7 +620,7 @@ class Runtime {
}
}
if (!this._pendingPromises.size)
this._debugger.onPromiseSettled = undefined;
this._debugger.onDebuggerStatement = undefined;
this._debugger.removeDebuggee(destroyedContext._contextGlobal);
this._executionContexts.delete(destroyedContext._id);
if (destroyedContext._domWindow)
Expand Down
5 changes: 5 additions & 0 deletions ci/run_sundial.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,10 +719,15 @@ async def scan(
f"{base_url.rstrip('/')}/?auto=1&score=1&post="
+ urllib.parse.quote(f"http://127.0.0.1:{collector.port}/collect", safe="")
)
# The report reaches the collector as a public page POSTing to loopback.
# From Firefox 156 that request is held for a Local Network Access
# prompt nobody can answer, so exempt sundial's own origin -- the
# permission state the page can read stays stock ("prompt").
async with AsyncCamoufox(
executable_path=str(binary),
headless=headless,
os=os_name,
firefox_user_prefs={"network.lna.skip-domains": host},
i_know_what_im_doing=True,
) as browser:
context = await browser.new_context()
Expand Down
71 changes: 31 additions & 40 deletions patches/anti-font-fingerprinting.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
diff --git a/dom/base/RoverfoxStorageManager.cpp b/dom/base/RoverfoxStorageManager.cpp
new file mode 100644
index 0000000000..dcb359d25a
index 0000000000..c172727062
--- /dev/null
+++ b/dom/base/RoverfoxStorageManager.cpp
@@ -0,0 +1,236 @@
Expand Down Expand Up @@ -242,7 +242,7 @@ index 0000000000..dcb359d25a
+} // namespace mozilla
diff --git a/dom/base/RoverfoxStorageManager.h b/dom/base/RoverfoxStorageManager.h
new file mode 100644
index 0000000000..e6d64378e1
index 0000000000..92dbb8aa07
--- /dev/null
+++ b/dom/base/RoverfoxStorageManager.h
@@ -0,0 +1,43 @@
Expand Down Expand Up @@ -290,18 +290,18 @@ index 0000000000..e6d64378e1
+
+#endif // mozilla_dom_RoverfoxStorageManager_h
diff --git a/dom/base/moz.build b/dom/base/moz.build
index 7e8d942191..e44e7259bf 100644
index 4cab12c55e..ab6d76a796 100644
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -257,6 +257,7 @@ EXPORTS.mozilla.dom += [
@@ -260,6 +260,7 @@ EXPORTS.mozilla.dom += [
"RequestCallbackManager.h",
"ResizeObserver.h",
"ResponsiveImageSelector.h",
+ "RoverfoxStorageManager.h",
"SameProcessMessageQueue.h",
"ScreenLuminance.h",
"ScreenOrientation.h",
@@ -461,6 +462,7 @@ UNIFIED_SOURCES += [
@@ -475,6 +476,7 @@ UNIFIED_SOURCES += [
"RemoteOuterWindowProxy.cpp",
"ResizeObserver.cpp",
"ResponsiveImageSelector.cpp",
Expand All @@ -310,7 +310,7 @@ index 7e8d942191..e44e7259bf 100644
"ScreenLuminance.cpp",
"ScreenOrientation.cpp",
diff --git a/dom/base/nsGlobalWindowInner.cpp b/dom/base/nsGlobalWindowInner.cpp
index 7cdddd10c1..922ddbc377 100644
index f6307312b3..64768a46a9 100644
--- a/dom/base/nsGlobalWindowInner.cpp
+++ b/dom/base/nsGlobalWindowInner.cpp
@@ -56,6 +56,7 @@
Expand All @@ -321,7 +321,7 @@ index 7cdddd10c1..922ddbc377 100644
#include "mozilla/ExtensionPolicyService.h"
#include "mozilla/FloatingPoint.h"
#include "mozilla/FlushType.h"
@@ -241,6 +242,8 @@
@@ -240,6 +241,8 @@
#include "nsICookieService.h"
#include "nsID.h"
#include "nsIDOMStorageManager.h"
Expand All @@ -331,10 +331,10 @@ index 7cdddd10c1..922ddbc377 100644
#include "nsIDeviceSensors.h"
#include "nsIDocShell.h"
diff --git a/dom/canvas/OffscreenCanvas.cpp b/dom/canvas/OffscreenCanvas.cpp
index 7234240711..df84b793dc 100644
index 345455c14e..f46f13ebf6 100644
--- a/dom/canvas/OffscreenCanvas.cpp
+++ b/dom/canvas/OffscreenCanvas.cpp
@@ -654,6 +654,15 @@ void OffscreenCanvas::ReportBlockedFontFamily(const nsCString& aMsg) const {
@@ -655,6 +655,15 @@ void OffscreenCanvas::ReportBlockedFontFamily(const nsCString& aMsg) const {
}
}

Expand All @@ -351,10 +351,10 @@ index 7234240711..df84b793dc 100644
if (NS_IsMainThread()) {
nsCOMPtr<nsPIDOMWindowInner> win = do_QueryInterface(GetRelevantGlobal());
diff --git a/dom/workers/WorkerPrivate.h b/dom/workers/WorkerPrivate.h
index 7f56e1c86d..80b050c08b 100644
index b38f31f547..2321f5acd5 100644
--- a/dom/workers/WorkerPrivate.h
+++ b/dom/workers/WorkerPrivate.h
@@ -1107,8 +1107,6 @@ class WorkerPrivate final
@@ -1161,8 +1161,6 @@ class WorkerPrivate final

void WorkerScriptLoaded();

Expand All @@ -364,10 +364,10 @@ index 7f56e1c86d..80b050c08b 100644

void UpdateContextOptions(const JS::ContextOptions& aContextOptions);
diff --git a/gfx/thebes/gfxPlatformFontList.cpp b/gfx/thebes/gfxPlatformFontList.cpp
index b3c22e2bb1..6bdcd2a57c 100644
index a0b8c260c4..2ea46a9810 100644
--- a/gfx/thebes/gfxPlatformFontList.cpp
+++ b/gfx/thebes/gfxPlatformFontList.cpp
@@ -448,6 +448,7 @@ class ListFontsVisibilityProvider final : public FontVisibilityProvider {
@@ -455,6 +455,7 @@ class ListFontsVisibilityProvider final : public FontVisibilityProvider {
return mozilla::Nothing();
}
void UserFontSetUpdated(gfxUserFontEntry*) override {}
Expand All @@ -376,38 +376,29 @@ index b3c22e2bb1..6bdcd2a57c 100644

private:
diff --git a/gfx/thebes/gfxTextRun.cpp b/gfx/thebes/gfxTextRun.cpp
index fc1293be42..cac43a8b1f 100644
index f2c42a498e..2191ce6129 100644
--- a/gfx/thebes/gfxTextRun.cpp
+++ b/gfx/thebes/gfxTextRun.cpp
@@ -24,6 +24,7 @@
@@ -18,6 +18,7 @@
#include "mozilla/Likely.h"
#include "mozilla/MruCache.h"
#include "mozilla/ServoStyleSet.h"
+#include "mozilla/ServoStyleSetInlines.h"
#include "mozilla/Sprintf.h"
#include "mozilla/StaticPresData.h"
#include "mozilla/UniquePtr.h"
@@ -33,6 +34,9 @@
@@ -33,6 +34,10 @@
#include "nsStyleConsts.h"
#include "nsStyleUtil.h"
#include "nsUnicodeProperties.h"
#include "SharedFontList-impl.h"
#include "TextDrawTarget.h"
+#include "mozilla/dom/BrowsingContext.h"
+#include "mozilla/dom/Document.h"
+#include "nsPIDOMWindow.h"
+#include "nsPIDOMWindowInlines.h"

#ifdef XP_WIN
# include "gfxWindowsPlatform.h"
@@ -699,7 +703,8 @@ void gfxTextRun::DrawEmphasisMarks(
gfxContext* aContext, gfxTextRun* aMark, gfxFloat aMarkAdvance,
gfx::Point aPt, Range aRange, const PropertyProvider* aProvider,
mozilla::gfx::PaletteCache& aPaletteCache) const {
- MOZ_ASSERT(aRange.end <= GetLength());
+ MOZ_ASSERT(
+ aRange.end <= GetLength());

EmphasisMarkDrawParams params(aContext, aPaletteCache);
params.mark = aMark;
@@ -1841,6 +1846,18 @@ gfxFontGroup::gfxFontGroup(FontVisibilityProvider* aFontVisibilityProvider,
@@ -1871,6 +1876,18 @@ gfxFontGroup::gfxFontGroup(FontVisibilityProvider* aFontVisibilityProvider,
mFontVariantEmoji(aVariantEmoji) {
// We don't use SetUserFontSet() here, as we want to unconditionally call
// EnsureFontList() rather than only do UpdateUserFonts() if it changed.
Expand All @@ -426,7 +417,7 @@ index fc1293be42..cac43a8b1f 100644
}

gfxFontGroup::~gfxFontGroup() {
@@ -2583,8 +2600,9 @@ static Script ResolveScriptForLang(const nsAtom* aLanguage, Script aDefault) {
@@ -2598,8 +2615,9 @@ static Script ResolveScriptForLang(const nsAtom* aLanguage, Script aDefault) {
static LangScriptCache sCache;
static RWLock sLock("LangScriptCache lock");

Expand All @@ -438,20 +429,20 @@ index fc1293be42..cac43a8b1f 100644

{
// Try to use a cached value without taking an exclusive lock.
@@ -3418,7 +3436,7 @@ already_AddRefed<gfxFont> gfxFontGroup::FindFontForChar(
font = FindFallbackFaceForChar(ff, aCh, aNextCh, presentation);
if (font) {
if (CheckCandidate(font,
- {FontMatchType::Kind::kFontGroup, ff.Generic()})) {
@@ -3479,7 +3497,7 @@ already_AddRefed<gfxFont> gfxFontGroup::FindFontForChar(
font = FindFallbackFaceForChar(ff, aCh, aNextCh, presentation);
if (font) {
if (CheckCandidate(font,
- {FontMatchType::Kind::kFontGroup, ff.Generic()})) {
+ {FontMatchType::Kind::kFontGroup, mFonts[i].Generic()})) {
return font.forget();
}
return font.forget();
}
}
diff --git a/gfx/thebes/gfxTextRun.h b/gfx/thebes/gfxTextRun.h
index 85aecf5fdd..79f4df71a4 100644
index f04c835506..10ddd68fc1 100644
--- a/gfx/thebes/gfxTextRun.h
+++ b/gfx/thebes/gfxTextRun.h
@@ -1401,6 +1401,8 @@ class gfxFontGroup final : public gfxTextRunFactory {
@@ -1433,6 +1433,8 @@ class gfxFontGroup final : public gfxTextRunFactory {
uint32_t mFontListGeneration = 0; // platform font list generation for this
// fontgroup

Expand All @@ -461,7 +452,7 @@ index 85aecf5fdd..79f4df71a4 100644
* Textrun creation short-cuts for special cases where we don't need to
* call a font shaper to generate glyphs.
diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp
index b2394c6106..da755e553c 100644
index 02a771ca93..8d6bbebed3 100644
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -426,6 +426,10 @@ bool nsPresContext::IsChrome() const {
Expand Down
Loading
Loading