Loading browser/components/resistfingerprinting/test/browser/browser_navigator_iframes.js +7 −0 Original line number Diff line number Diff line Loading @@ -331,6 +331,13 @@ add_task(async () => { await simpleRFPTest(uri, testNavigator, expectedResults); }); add_task(async () => { expectedResults = structuredClone(allSpoofed); await simpleRFPTest(uri, testNavigator, expectedResults, {}, [ ["pdfjs.disabled", true], ]); }); // In the below tests, we use the cross-origin domain as the base URI of a resource we fetch (on both the framer and framee) // so we can check that the HTTP header is as expected. Loading dom/base/Navigator.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -510,7 +510,11 @@ nsPluginArray* Navigator::GetPlugins(ErrorResult& aRv) { return mPlugins; } bool Navigator::PdfViewerEnabled() { return !StaticPrefs::pdfjs_disabled(); } bool Navigator::PdfViewerEnabled() { return !StaticPrefs::pdfjs_disabled() || nsContentUtils::ShouldResistFingerprinting(GetDocShell(), RFPTarget::PdfjsSpoof); } Permissions* Navigator::GetPermissions(ErrorResult& aRv) { if (!mWindow) { Loading dom/base/nsMimeTypeArray.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,11 @@ void nsMimeTypeArray::GetSupportedNames(nsTArray<nsString>& retval) { } } bool nsMimeTypeArray::ForceNoPlugins() { return StaticPrefs::pdfjs_disabled(); } bool nsMimeTypeArray::ForceNoPlugins() { return StaticPrefs::pdfjs_disabled() && !nsContentUtils::ShouldResistFingerprinting( mWindow ? mWindow->GetDocShell() : nullptr, RFPTarget::PdfjsSpoof); } NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsMimeType, mPluginElement) Loading dom/base/nsPluginArray.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -97,7 +97,11 @@ void nsPluginArray::GetSupportedNames(nsTArray<nsString>& aRetval) { } } bool nsPluginArray::ForceNoPlugins() { return StaticPrefs::pdfjs_disabled(); } bool nsPluginArray::ForceNoPlugins() { return StaticPrefs::pdfjs_disabled() && !nsContentUtils::ShouldResistFingerprinting( mWindow ? mWindow->GetDocShell() : nullptr, RFPTarget::PdfjsSpoof); } NS_IMPL_CYCLE_COLLECTING_ADDREF(nsPluginArray) NS_IMPL_CYCLE_COLLECTING_RELEASE(nsPluginArray) Loading toolkit/components/resistfingerprinting/RFPTargets.inc +2 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,8 @@ ITEM_VALUE(NavigatorHWConcurrency, 16) ITEM_VALUE(NavigatorOscpu, 17) ITEM_VALUE(NavigatorPlatform, 18) ITEM_VALUE(NavigatorUserAgent, 19) ITEM_VALUE(PointerId, 20) // If the user disables PDFJS via a pref, we do not expose that to the web ITEM_VALUE(PdfjsSpoof, 20) ITEM_VALUE(StreamVideoFacingMode, 21) ITEM_VALUE(JSDateTimeUTC, 22) ITEM_VALUE(JSMathFdlibm, 23) Loading Loading
browser/components/resistfingerprinting/test/browser/browser_navigator_iframes.js +7 −0 Original line number Diff line number Diff line Loading @@ -331,6 +331,13 @@ add_task(async () => { await simpleRFPTest(uri, testNavigator, expectedResults); }); add_task(async () => { expectedResults = structuredClone(allSpoofed); await simpleRFPTest(uri, testNavigator, expectedResults, {}, [ ["pdfjs.disabled", true], ]); }); // In the below tests, we use the cross-origin domain as the base URI of a resource we fetch (on both the framer and framee) // so we can check that the HTTP header is as expected. Loading
dom/base/Navigator.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -510,7 +510,11 @@ nsPluginArray* Navigator::GetPlugins(ErrorResult& aRv) { return mPlugins; } bool Navigator::PdfViewerEnabled() { return !StaticPrefs::pdfjs_disabled(); } bool Navigator::PdfViewerEnabled() { return !StaticPrefs::pdfjs_disabled() || nsContentUtils::ShouldResistFingerprinting(GetDocShell(), RFPTarget::PdfjsSpoof); } Permissions* Navigator::GetPermissions(ErrorResult& aRv) { if (!mWindow) { Loading
dom/base/nsMimeTypeArray.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,11 @@ void nsMimeTypeArray::GetSupportedNames(nsTArray<nsString>& retval) { } } bool nsMimeTypeArray::ForceNoPlugins() { return StaticPrefs::pdfjs_disabled(); } bool nsMimeTypeArray::ForceNoPlugins() { return StaticPrefs::pdfjs_disabled() && !nsContentUtils::ShouldResistFingerprinting( mWindow ? mWindow->GetDocShell() : nullptr, RFPTarget::PdfjsSpoof); } NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsMimeType, mPluginElement) Loading
dom/base/nsPluginArray.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -97,7 +97,11 @@ void nsPluginArray::GetSupportedNames(nsTArray<nsString>& aRetval) { } } bool nsPluginArray::ForceNoPlugins() { return StaticPrefs::pdfjs_disabled(); } bool nsPluginArray::ForceNoPlugins() { return StaticPrefs::pdfjs_disabled() && !nsContentUtils::ShouldResistFingerprinting( mWindow ? mWindow->GetDocShell() : nullptr, RFPTarget::PdfjsSpoof); } NS_IMPL_CYCLE_COLLECTING_ADDREF(nsPluginArray) NS_IMPL_CYCLE_COLLECTING_RELEASE(nsPluginArray) Loading
toolkit/components/resistfingerprinting/RFPTargets.inc +2 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,8 @@ ITEM_VALUE(NavigatorHWConcurrency, 16) ITEM_VALUE(NavigatorOscpu, 17) ITEM_VALUE(NavigatorPlatform, 18) ITEM_VALUE(NavigatorUserAgent, 19) ITEM_VALUE(PointerId, 20) // If the user disables PDFJS via a pref, we do not expose that to the web ITEM_VALUE(PdfjsSpoof, 20) ITEM_VALUE(StreamVideoFacingMode, 21) ITEM_VALUE(JSDateTimeUTC, 22) ITEM_VALUE(JSMathFdlibm, 23) Loading