From 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:33 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- toolkit/actors/AutoCompleteParent.sys.mjs | 3 +- toolkit/actors/AutoScrollChild.sys.mjs | 30 +- toolkit/actors/FindBarChild.sys.mjs | 7 +- toolkit/actors/PictureInPictureChild.sys.mjs | 12 +- toolkit/actors/SelectChild.sys.mjs | 12 +- toolkit/actors/SelectParent.sys.mjs | 2 +- .../components/aboutconfig/content/aboutconfig.js | 1 + .../aboutconfig/test/browser/browser.toml | 3 +- .../aboutconfig/test/browser/browser_clipboard.js | 17 + .../aboutconfig/test/browser/browser_edit.js | 21 + .../components/aboutmemory/content/aboutMemory.js | 6 +- .../antitracking/ContentBlockingAllowList.cpp | 69 ++ .../antitracking/ContentBlockingAllowList.h | 56 +- .../antitracking/ContentBlockingAllowList.sys.mjs | 2 +- .../antitracking/PurgeTrackerService.sys.mjs | 2 +- .../URLDecorationAnnotationsService.sys.mjs | 2 +- .../antitracking/URLQueryStringStripper.cpp | 4 +- .../BounceTrackingProtection.cpp | 123 +++- .../BounceTrackingProtection.h | 28 +- .../BounceTrackingRecord.cpp | 13 +- .../BounceTrackingRecord.h | 15 +- .../BounceTrackingState.cpp | 17 +- .../bouncetrackingprotection/BounceTrackingState.h | 6 +- .../BounceTrackingStateGlobal.cpp | 32 +- .../BounceTrackingStateGlobal.h | 11 + .../nsIBounceTrackingProtection.idl | 4 + .../test/browser/browser_bouncetracking_purge.js | 66 ++ ...st_bouncetracking_clearExpiredUserActivation.js | 85 +++ .../test/xpcshell/xpcshell.toml | 2 + .../antitracking/test/browser/3rdPartySVG.html | 2 +- .../antitracking/test/browser/3rdPartyWorker.html | 2 +- .../antitracking/test/browser/antitracking_head.js | 12 +- .../test/browser/blobPartitionPage.html | 2 +- .../test/browser/browser-blocking.toml | 6 +- .../test/browser/browser_aboutblank.js | 4 +- .../browser_addonHostPermissionIgnoredInTP.js | 2 +- .../test/browser/browser_allowListNotifications.js | 2 +- ...owser_allowListNotifications_alwaysPartition.js | 2 +- ...allowListSeparationInPrivateAndNormalWindows.js | 2 +- .../browser/browser_allowPermissionForTracker.js | 4 +- .../browser/browser_backgroundImageAssertion.js | 2 +- .../test/browser/browser_blockingCookies.js | 4 +- .../test/browser/browser_blockingDOMCache.js | 2 +- .../browser_blockingDOMCacheAlwaysPartition.js | 2 +- .../browser_blockingDOMCacheAlwaysPartitionSAA.js | 2 +- .../test/browser/browser_blockingDOMCacheSAA.js | 2 +- .../test/browser/browser_blockingIndexedDb.js | 4 +- .../browser/browser_blockingIndexedDbInWorkers.js | 6 +- .../browser/browser_blockingIndexedDbInWorkers2.js | 10 +- .../test/browser/browser_blockingLocalStorage.js | 4 +- .../test/browser/browser_blockingMessaging.js | 20 +- .../test/browser/browser_blockingNoOpener.js | 2 +- .../test/browser/browser_blockingServiceWorkers.js | 2 +- ...owser_blockingServiceWorkersStorageAccessAPI.js | 2 +- .../test/browser/browser_blockingSessionStorage.js | 4 +- .../test/browser/browser_blockingSharedWorkers.js | 4 +- .../browser_contentBlockingAllowListPrincipal.js | 14 +- .../browser/browser_contentBlockingTelemetry.js | 3 +- .../test/browser/browser_cookieBetweenTabs.js | 2 +- .../browser/browser_denyPermissionForTracker.js | 2 +- .../test/browser/browser_doublyNestedTracker.js | 2 +- .../browser_existingCookiesForSubresources.js | 2 +- ...er_firstPartyCookieRejectionHonoursAllowList.js | 4 +- .../test/browser/browser_hasStorageAccess.js | 2 +- .../browser_hasStorageAccess_alwaysPartition.js | 2 +- .../test/browser/browser_localStorageEvents.js | 4 +- ...odifyRequestNotificationForTrackingResources.js | 4 +- .../browser/browser_partitionedConsoleMessage.js | 2 +- .../test/browser/browser_partitionedCookies.js | 20 +- .../test/browser/browser_partitionedDOMCache.js | 14 +- .../test/browser/browser_partitionedIndexedDB.js | 6 +- .../browser/browser_partitionedLocalStorage.js | 4 +- .../browser_partitionedLocalStorage_events.js | 2 +- .../test/browser/browser_partitionedLockManager.js | 4 +- .../test/browser/browser_partitionedMessaging.js | 4 +- .../browser/browser_partitionedServiceWorkers.js | 40 +- .../browser/browser_partitionedSharedWorkers.js | 4 +- .../browser/browser_permissionInNormalWindows.js | 5 +- ...er_permissionInNormalWindows_alwaysPartition.js | 6 +- .../browser/browser_permissionInPrivateWindows.js | 2 +- ...r_permissionInPrivateWindows_alwaysPartition.js | 2 +- .../test/browser/browser_permissionPropagation.js | 6 +- .../test/browser/browser_referrerDefaultPolicy.js | 2 +- .../antitracking/test/browser/browser_script.js | 2 +- .../browser/browser_siteSpecificWorkArounds.js | 8 +- .../browser/browser_socialtracking_save_image.js | 2 +- .../test/browser/browser_staticPartition_cache.js | 2 +- .../browser/browser_staticPartition_network.js | 2 +- .../test/browser/browser_staticPartition_saveAs.js | 6 +- .../browser/browser_staticPartition_tls_session.js | 2 +- .../browser/browser_storageAccessDoorHanger.js | 2 +- .../browser/browser_storageAccessPrivilegeAPI.js | 2 +- ...ageAccessPromiseRejectHandlerUserInteraction.js | 2 +- ...RejectHandlerUserInteraction_alwaysPartition.js | 2 +- ...geAccessPromiseResolveHandlerUserInteraction.js | 2 +- ...browser_storageAccessRemovalNavigateSubframe.js | 2 +- ...ccessRemovalNavigateSubframe_alwaysPartition.js | 2 +- ...browser_storageAccessRemovalNavigateTopframe.js | 2 +- ...ccessRemovalNavigateTopframe_alwaysPartition.js | 2 +- .../test/browser/browser_storageAccessSandboxed.js | 6 +- ...owser_storageAccessSandboxed_alwaysPartition.js | 6 +- .../browser_storageAccessThirdPartyChecks.js | 6 +- ...torageAccessThirdPartyChecks_alwaysPartition.js | 6 +- .../browser/browser_storageAccessWithDynamicFpi.js | 2 +- .../browser/browser_storageAccessWithHeuristics.js | 22 +- .../browser_storageAccess_TopLevel_Arguments.js | 2 +- ...rowser_storageAccess_TopLevel_CookieBehavior.js | 2 +- ...wser_storageAccess_TopLevel_CookiePermission.js | 2 +- ...r_storageAccess_TopLevel_CrossOriginSameSite.js | 2 +- .../browser_storageAccess_TopLevel_Doorhanger.js | 2 +- .../browser_storageAccess_TopLevel_Embed.js | 2 +- .../browser_storageAccess_TopLevel_Enable.js | 2 +- ...ccess_TopLevel_RequireIntermediatePermission.js | 2 +- ...orageAccess_TopLevel_StorageAccessPermission.js | 2 +- ...rowser_storageAccess_TopLevel_UserActivation.js | 2 +- .../test/browser/browser_subResources.js | 2 +- .../browser/browser_subResourcesPartitioned.js | 2 +- ...wser_subResourcesPartitioned_alwaysPartition.js | 2 +- .../browser_thirdPartyStorageRejectionForCORS.js | 2 +- .../test/browser/browser_urlDecorationStripping.js | 2 +- ...owser_urlDecorationStripping_alwaysPartition.js | 2 +- .../browser/browser_urlQueryStringStripping.js | 2 +- .../browser_urlQueryStringStripping_allowList.js | 2 +- .../test/browser/browser_userInteraction.js | 8 +- .../test/browser/browser_workerPropagation.js | 2 +- .../test/browser/file_saveAsPageInfo.html | 4 +- .../components/antitracking/test/browser/head.js | 2 + .../antitracking/test/browser/imageCacheWorker.js | 2 +- .../antitracking/test/browser/localStorage.html | 2 +- .../test/browser/partitionedstorage_head.js | 17 +- .../test/browser/storage_access_head.js | 2 +- .../antitracking/test/browser/tracker.js | 2 +- .../antitracking/test/browser/workerIframe.html | 2 +- .../test/xpcshell/test_staticPartition_authhttp.js | 2 +- .../test/xpcshell/test_staticPartition_prefetch.js | 2 +- .../test/xpcshell/test_staticPartition_preload.js | 2 +- .../antitracking/test/xpcshell/xpcshell.toml | 7 +- toolkit/components/apppicker/content/appPicker.js | 6 +- .../components/asyncshutdown/AsyncShutdown.sys.mjs | 3 +- .../components/asyncshutdown/nsIAsyncShutdown.idl | 4 - .../backgroundhangmonitor/ThreadStackHelper.cpp | 3 +- .../backgroundhangmonitor/ThreadStackHelper.h | 3 +- toolkit/components/bitsdownload/nsIBits.idl | 7 - .../cleardata/PrincipalsCollector.sys.mjs | 2 +- .../cleardata/ServiceWorkerCleanUp.sys.mjs | 2 +- .../components/cleardata/nsIClearDataService.idl | 2 +- .../test_moved_origin_directory_cleanup.py | 11 + .../cleardata/tests/unit/test_cookies.js | 71 ++ .../components/contentanalysis/ContentAnalysis.cpp | 437 ++++++++++--- .../components/contentanalysis/ContentAnalysis.h | 42 +- toolkit/components/contentanalysis/moz.build | 124 ++-- .../contentanalysis/nsIContentAnalysis.idl | 18 + .../contentanalysis/tests/browser/browser.toml | 3 + .../browser/browser_content_analysis_policies.js | 127 ++++ .../contentanalysis/tests/browser/moz.build | 7 + .../tests/gtest/TestContentAnalysis.cpp | 214 +++--- .../tests/gtest/TestContentAnalysis.h | 24 - .../tests/gtest/TestContentAnalysisAgent.cpp | 132 ++++ .../tests/gtest/TestContentAnalysisAgent.h | 24 + .../tests/gtest/TestContentAnalysisMisbehaving.cpp | 2 +- .../tests/gtest/TestContentAnalysisUtils.cpp | 2 +- .../contentanalysis/tests/gtest/moz.build | 4 + toolkit/components/contentanalysis/tests/moz.build | 7 + .../ContextualIdentityService.sys.mjs | 2 +- .../components/corroborator/Corroborate.sys.mjs | 12 +- toolkit/components/crashes/CrashManager.in.sys.mjs | 3 +- .../IdentityCredentialPromptService.sys.mjs | 12 +- .../IdentityCredentialStorageService.cpp | 19 +- toolkit/components/downloads/DownloadCore.sys.mjs | 4 +- .../components/downloads/DownloadHistory.sys.mjs | 4 +- .../downloads/DownloadIntegration.sys.mjs | 2 +- .../components/downloads/DownloadLegacy.sys.mjs | 14 +- toolkit/components/downloads/DownloadList.sys.mjs | 2 +- .../downloads/test/unit/common_test_Download.js | 35 +- toolkit/components/downloads/test/unit/head.js | 10 +- .../downloads/test/unit/test_DownloadHistory.js | 2 +- .../downloads/test/unit/test_DownloadLegacy.js | 2 + .../downloads/test/unit/test_DownloadList.js | 4 +- .../downloads/test/unit/test_Download_noext_win.js | 2 +- .../enterprisepolicies/WindowsGPOParser.sys.mjs | 2 +- .../enterprisepolicies/macOSPoliciesParser.sys.mjs | 2 +- toolkit/components/extensions/.eslintrc.js | 8 +- .../components/extensions/ConduitsChild.sys.mjs | 2 +- toolkit/components/extensions/Extension.sys.mjs | 45 +- .../components/extensions/ExtensionActions.sys.mjs | 32 +- .../components/extensions/ExtensionChild.sys.mjs | 10 +- .../components/extensions/ExtensionCommon.sys.mjs | 74 +-- .../components/extensions/ExtensionContent.sys.mjs | 4 +- toolkit/components/extensions/ExtensionDNR.sys.mjs | 18 +- .../extensions/ExtensionPageChild.sys.mjs | 4 +- .../components/extensions/ExtensionParent.sys.mjs | 26 +- .../extensions/ExtensionPermissions.sys.mjs | 5 +- .../extensions/ExtensionPolicyService.cpp | 9 +- .../extensions/ExtensionProcessScript.sys.mjs | 4 +- .../extensions/ExtensionScriptingStore.sys.mjs | 10 +- .../components/extensions/ExtensionStorage.sys.mjs | 2 +- .../extensions/ExtensionStorageIDB.sys.mjs | 2 +- .../extensions/ExtensionStorageSync.sys.mjs | 2 +- .../extensions/ExtensionStorageSyncKinto.sys.mjs | 6 +- .../extensions/ExtensionTelemetry.sys.mjs | 4 +- .../extensions/ExtensionTestCommon.sys.mjs | 2 +- .../components/extensions/ExtensionUtils.sys.mjs | 2 +- .../extensions/ExtensionWorkerChild.sys.mjs | 2 +- .../extensions/ExtensionXPCShellUtils.sys.mjs | 6 +- toolkit/components/extensions/ExtensionsParent.cpp | 4 +- .../components/extensions/MessageChannel.sys.mjs | 10 +- .../extensions/MessageManagerProxy.sys.mjs | 2 +- .../extensions/ProxyChannelFilter.sys.mjs | 8 +- toolkit/components/extensions/Schemas.sys.mjs | 44 +- .../components/extensions/WebNavigation.sys.mjs | 3 +- .../extensions/child/ext-declarativeNetRequest.js | 2 +- toolkit/components/extensions/child/ext-storage.js | 8 +- toolkit/components/extensions/child/ext-test.js | 4 +- .../extensions/child/ext-userScripts-content.js | 2 +- .../components/extensions/docs/webext-storage.rst | 2 +- .../components/extensions/docs/webidl_bindings.rst | 2 +- toolkit/components/extensions/metrics.yaml | 24 +- toolkit/components/extensions/parent/ext-alarms.js | 4 +- .../extensions/parent/ext-backgroundPage.js | 4 +- .../extensions/parent/ext-browsingData.js | 4 +- .../extensions/parent/ext-captivePortal.js | 10 +- .../components/extensions/parent/ext-clipboard.js | 2 +- .../extensions/parent/ext-contextualIdentities.js | 2 +- .../extensions/parent/ext-declarativeNetRequest.js | 2 +- toolkit/components/extensions/parent/ext-dns.js | 2 +- .../components/extensions/parent/ext-downloads.js | 11 +- .../extensions/parent/ext-geckoProfiler.js | 2 +- .../components/extensions/parent/ext-identity.js | 4 +- toolkit/components/extensions/parent/ext-idle.js | 2 +- .../components/extensions/parent/ext-management.js | 2 +- .../extensions/parent/ext-networkStatus.js | 2 +- .../extensions/parent/ext-protocolHandlers.js | 2 +- .../components/extensions/parent/ext-runtime.js | 4 +- .../components/extensions/parent/ext-scripting.js | 6 +- .../components/extensions/parent/ext-storage.js | 4 +- .../components/extensions/parent/ext-tabs-base.js | 77 +-- toolkit/components/extensions/parent/ext-theme.js | 2 +- .../extensions/parent/ext-webNavigation.js | 2 +- .../storage/webext_storage_bridge/src/lib.rs | 4 +- .../browser_ext_background_serviceworker.js | 2 +- .../test/browser/browser_ext_downloads_filters.js | 2 +- .../test/browser/browser_ext_downloads_referrer.js | 6 +- .../browser_ext_extension_page_tab_navigated.js | 2 +- .../test/browser/browser_ext_management_themes.js | 2 +- .../test/browser/browser_ext_themes_arrowpanels.js | 4 +- .../test/browser/browser_ext_themes_incognito.js | 2 +- .../browser_ext_themes_ntp_colors_perwindow.js | 3 +- .../test/mochitest/chrome_cleanup_script.js | 2 +- .../extensions/test/mochitest/file_indexedDB.html | 2 +- .../test/mochitest/file_simple_iframe_worker.html | 4 +- .../mochitest/file_simple_webrequest_worker.html | 4 +- .../extensions/test/mochitest/head_cookies.js | 2 +- .../extensions/test/mochitest/head_webrequest.js | 8 +- .../test/mochitest/mochitest-common.toml | 1 + .../test_chrome_ext_downloads_saveAs.html | 2 +- .../test_chrome_ext_downloads_uniquify.html | 2 +- .../mochitest/test_chrome_ext_permissions.html | 2 +- ...st_chrome_ext_webrequest_background_events.html | 4 +- .../test_chrome_ext_webrequest_mozextension.html | 2 +- .../test/mochitest/test_ext_activityLog.html | 4 +- .../test/mochitest/test_ext_async_clipboard.html | 8 +- .../mochitest/test_ext_browsingData_indexedDB.html | 2 +- .../test_ext_browsingData_localStorage.html | 2 +- .../test_ext_browsingData_serviceWorkers.html | 2 +- .../mochitest/test_ext_browsingData_settings.html | 8 +- .../mochitest/test_ext_exclude_include_globs.html | 4 +- .../test_ext_extension_iframe_messaging.html | 2 +- .../test/mochitest/test_ext_redirect_jar.html | 2 +- .../test_ext_request_urlClassification.html | 2 +- .../test_ext_sendmessage_doublereply.html | 2 +- .../mochitest/test_ext_sendmessage_reply2.html | 4 +- .../test/mochitest/test_ext_storage_cleanup.html | 2 +- .../mochitest/test_ext_streamfilter_multiple.html | 2 +- .../test_ext_streamfilter_processswitch.html | 2 +- .../mochitest/test_ext_subframes_privileges.html | 2 +- .../test_ext_tabs_executeScript_good.html | 2 +- .../test/mochitest/test_ext_tabs_permissions.html | 7 +- .../test_ext_web_accessible_incognito.html | 2 +- .../test_ext_web_accessible_resources.html | 2 +- .../test/mochitest/test_ext_webrequest_auth.html | 10 +- .../test_ext_webrequest_background_events.html | 2 +- .../test/mochitest/test_ext_webrequest_basic.html | 2 +- .../test/mochitest/test_ext_webrequest_errors.html | 2 +- .../test/mochitest/test_ext_webrequest_hsts.html | 10 +- .../test_ext_webrequest_redirect_bypass_cors.html | 2 +- .../test/mochitest/webrequest_chromeworker.js | 2 +- .../test/xpcshell/data/file_page_xhr.html | 2 +- .../test/xpcshell/data/file_permission_xhr.html | 2 +- .../components/extensions/test/xpcshell/head.js | 22 +- .../extensions/test/xpcshell/head_schemas.js | 4 +- .../test/xpcshell/head_service_worker.js | 2 +- .../extensions/test/xpcshell/test_csp_validator.js | 6 +- .../test/xpcshell/test_ext_alarms_does_not_fire.js | 2 +- ...est_ext_api_events_listener_calls_exceptions.js | 1 + .../test/xpcshell/test_ext_captivePortal.js | 5 - .../xpcshell/test_ext_contentScripts_register.js | 2 +- .../test/xpcshell/test_ext_contentscript.js | 2 +- .../xpcshell/test_ext_contentscript_context.js | 2 +- .../test_ext_contentscript_create_iframe.js | 2 +- .../xpcshell/test_ext_contentscript_importmap.js | 2 +- .../test_ext_contentscript_module_import.js | 2 +- .../test_ext_contentscript_triggeringPrincipal.js | 2 +- .../extensions/test/xpcshell/test_ext_contexts.js | 4 +- .../test/xpcshell/test_ext_contexts_gc.js | 4 +- .../test/xpcshell/test_ext_dnr_allowAllRequests.js | 2 +- .../test/xpcshell/test_ext_dnr_download.js | 2 +- .../test/xpcshell/test_ext_dnr_modifyHeaders.js | 2 +- .../test/xpcshell/test_ext_dnr_webrequest.js | 4 +- .../extensions/test/xpcshell/test_ext_dns.js | 2 +- .../test/xpcshell/test_ext_downloads_download.js | 2 +- .../xpcshell/test_ext_downloads_partitionKey.js | 2 +- .../test/xpcshell/test_ext_downloads_search.js | 2 +- .../test/xpcshell/test_ext_downloads_urlencoded.js | 2 +- .../test/xpcshell/test_ext_eventpage_messaging.js | 4 +- .../test/xpcshell/test_ext_experiments.js | 8 +- .../extensions/test/xpcshell/test_ext_i18n.js | 8 +- .../test/xpcshell/test_ext_indexedDB_principal.js | 12 +- .../test/xpcshell/test_ext_management.js | 2 +- .../xpcshell/test_ext_management_uninstall_self.js | 6 +- .../test/xpcshell/test_ext_messaging_startup.js | 4 +- .../test/xpcshell/test_ext_native_messaging.js | 6 +- .../xpcshell/test_ext_notifications_incognito.js | 2 +- .../test/xpcshell/test_ext_permissions.js | 26 + .../test/xpcshell/test_ext_persistent_events.js | 4 +- .../test/xpcshell/test_ext_privacy_disable.js | 2 +- .../test_ext_proxy_authorization_via_proxyinfo.js | 2 +- .../test/xpcshell/test_ext_proxy_onauthrequired.js | 8 +- .../test/xpcshell/test_ext_proxy_settings.js | 4 +- .../test/xpcshell/test_ext_proxy_socks.js | 4 +- .../test/xpcshell/test_ext_proxy_startup.js | 4 +- .../extensions/test/xpcshell/test_ext_redirects.js | 10 +- .../test_ext_runtime_onInstalled_and_onStartup.js | 2 +- .../test/xpcshell/test_ext_runtime_ports.js | 2 +- .../test/xpcshell/test_ext_runtime_ports_gc.js | 2 +- .../test/xpcshell/test_ext_runtime_sendMessage.js | 4 +- .../test/xpcshell/test_ext_same_site_redirects.js | 2 +- .../extensions/test/xpcshell/test_ext_schemas.js | 6 +- .../test/xpcshell/test_ext_schemas_interactive.js | 4 +- .../test_ext_schemas_manifest_permissions.js | 2 +- .../test/xpcshell/test_ext_schemas_privileged.js | 2 +- .../test/xpcshell/test_ext_schemas_roots.js | 2 +- .../test_ext_scripting_persistAcrossSessions.js | 12 + .../test_ext_storage_idb_data_migration.js | 3 +- .../test/xpcshell/test_ext_storage_sanitizer.js | 2 +- .../test/xpcshell/test_ext_storage_sync_kinto.js | 117 ++-- .../test/xpcshell/test_ext_storage_tab.js | 2 +- .../test/xpcshell/test_ext_userScripts_exports.js | 4 +- .../test/xpcshell/test_ext_webRequest_auth.js | 2 +- .../test_ext_webRequest_cancelWithReason.js | 4 +- .../test/xpcshell/test_ext_webRequest_download.js | 2 +- .../test_ext_webRequest_filterResponseData.js | 2 +- .../xpcshell/test_ext_webRequest_permission.js | 4 +- .../test_ext_webRequest_redirectProperty.js | 4 +- .../xpcshell/test_ext_webRequest_responseBody.js | 40 +- .../test/xpcshell/test_ext_webRequest_startup.js | 22 +- .../test/xpcshell/test_ext_webRequest_suspend.js | 4 +- .../xpcshell/test_ext_webRequest_viewsource.js | 2 +- .../test/xpcshell/test_ext_webRequest_webSocket.js | 10 +- .../xpcshell/test_ext_web_accessible_resources.js | 8 +- .../test/xpcshell/test_native_manifests.js | 2 +- .../test/xpcshell/test_proxy_failover.js | 6 +- .../test/xpcshell/test_proxy_info_results.js | 29 +- .../test/xpcshell/test_proxy_listener.js | 6 +- .../test/xpcshell/test_webRequest_filtering.js | 2 +- .../xpcshell/webidl-api/test_ext_webidl_api.js | 18 +- .../test_ext_webidl_api_event_callback.js | 20 +- .../test_ext_webidl_api_request_handler.js | 2 +- .../test_ext_webidl_api_schema_errors.js | 2 +- .../test_ext_webidl_api_schema_formatters.js | 2 +- .../webidl-api/test_ext_webidl_runtime_port.js | 2 +- .../webidl-api/ExtensionAPIRequestForwarder.cpp | 6 +- .../webidl-api/GenerateWebIDLBindings.py | 4 +- .../extensions/webrequest/WebRequest.sys.mjs | 4 +- toolkit/components/find/nsFind.cpp | 1 - toolkit/components/find/nsWebBrowserFind.cpp | 1 - .../AutofillProfileAutoComplete.sys.mjs | 2 +- .../formautofill/AutofillTelemetry.sys.mjs | 629 ------------------ toolkit/components/formautofill/Constants.ios.mjs | 3 +- .../formautofill/FormAutofill.ios.sys.mjs | 2 +- .../components/formautofill/FormAutofill.sys.mjs | 4 +- .../formautofill/FormAutofillChild.ios.sys.mjs | 14 +- .../formautofill/FormAutofillChild.sys.mjs | 524 ++++++++++++--- .../formautofill/FormAutofillContent.sys.mjs | 367 +---------- .../components/formautofill/FormAutofillNative.cpp | 20 +- .../formautofill/FormAutofillParent.sys.mjs | 6 +- .../formautofill/FormAutofillStorageBase.sys.mjs | 193 ++---- .../formautofill/FormAutofillSync.sys.mjs | 2 +- toolkit/components/formautofill/Helpers.ios.mjs | 100 ++- toolkit/components/formautofill/Overrides.ios.js | 1 - .../formautofill/ProfileAutoCompleteResult.sys.mjs | 62 +- .../android/FormAutofillPrompter.sys.mjs | 8 +- .../android/FormAutofillStorage.sys.mjs | 10 +- .../default/FormAutofillPrompter.sys.mjs | 6 +- toolkit/components/formautofill/moz.build | 5 + .../phonenumberutils/PhoneNumber.sys.mjs | 474 -------------- .../phonenumberutils/PhoneNumberMetaData.sys.mjs | 291 --------- .../phonenumberutils/PhoneNumberNormalizer.sys.mjs | 67 -- .../formautofill/shared/AddressComponent.sys.mjs | 10 +- .../formautofill/shared/AddressParser.sys.mjs | 2 +- .../formautofill/shared/AddressRecord.sys.mjs | 119 ++++ .../formautofill/shared/AutofillTelemetry.sys.mjs | 629 ++++++++++++++++++ .../formautofill/shared/FieldScanner.sys.mjs | 13 + .../shared/FormAutofillHeuristics.sys.mjs | 72 +- .../shared/FormAutofillSection.sys.mjs | 24 +- .../formautofill/shared/FormAutofillUtils.sys.mjs | 39 +- .../formautofill/shared/FormStateManager.sys.mjs | 2 +- .../formautofill/shared/PhoneNumber.sys.mjs | 474 ++++++++++++++ .../shared/PhoneNumberMetaData.sys.mjs | 291 +++++++++ .../shared/PhoneNumberNormalizer.sys.mjs | 67 ++ toolkit/components/glean/Cargo.toml | 6 +- toolkit/components/glean/api/Cargo.toml | 3 +- .../glean/api/src/ffi/custom_distribution.rs | 2 + .../glean/api/src/ffi/memory_distribution.rs | 2 + toolkit/components/glean/api/src/ffi/mod.rs | 1 + toolkit/components/glean/api/src/ffi/object.rs | 68 ++ .../glean/api/src/ffi/timing_distribution.rs | 2 + toolkit/components/glean/api/src/pings.rs | 2 +- .../glean/api/src/private/custom_distribution.rs | 4 + toolkit/components/glean/api/src/private/mod.rs | 2 + toolkit/components/glean/api/src/private/object.rs | 83 +++ toolkit/components/glean/api/src/private/ping.rs | 4 +- .../glean/api/src/private/timing_distribution.rs | 4 + toolkit/components/glean/bindings/GleanMetric.h | 1 + toolkit/components/glean/bindings/MetricTypes.h | 1 + toolkit/components/glean/bindings/jog/src/lib.rs | 6 + .../glean/bindings/private/CustomDistribution.cpp | 8 +- .../glean/bindings/private/DistributionData.h | 6 +- .../glean/bindings/private/MemoryDistribution.cpp | 8 +- .../components/glean/bindings/private/Object.cpp | 80 +++ toolkit/components/glean/bindings/private/Object.h | 94 +++ .../components/glean/bindings/private/Timespan.cpp | 1 + .../glean/bindings/private/TimingDistribution.cpp | 29 +- .../glean/build_scripts/glean_parser_ext/jog.py | 1 + .../glean_parser_ext/run_glean_parser.py | 27 + .../glean/build_scripts/glean_parser_ext/rust.py | 37 +- .../glean_parser_ext/templates/cpp.jinja2 | 2 + .../glean_parser_ext/templates/jog_factory.jinja2 | 15 +- .../glean_parser_ext/templates/ohttp.jinja2 | 13 + .../glean_parser_ext/templates/rust.jinja2 | 106 +++ .../glean_parser_ext/templates/rust_pings.jinja2 | 1 + .../glean/build_scripts/mach_commands.py | 17 +- toolkit/components/glean/metrics_index.py | 3 + toolkit/components/glean/moz.build | 13 + toolkit/components/glean/pings.yaml | 5 +- .../components/glean/src/init/viaduct_uploader.rs | 205 ++++-- toolkit/components/glean/src/lib.rs | 10 +- toolkit/components/glean/src/ohttp_pings.rs | 13 + toolkit/components/glean/tags.yaml | 20 +- toolkit/components/glean/tests/gtest/TestFog.cpp | 6 + .../glean/tests/pytest/gifft_output_Event | 4 +- .../glean/tests/pytest/gifft_output_Scalar | 6 +- .../components/glean/tests/pytest/jogfile_output | 21 + .../glean/tests/pytest/metrics_test.yaml | 20 + .../glean/tests/pytest/metrics_test_output | 138 +++- .../glean/tests/pytest/metrics_test_output_cpp | 19 +- .../glean/tests/pytest/metrics_test_output_js_cpp | 104 +-- .../glean/tests/pytest/metrics_test_output_js_h | 2 +- .../components/glean/tests/pytest/pings_test.yaml | 18 +- .../glean/tests/pytest/pings_test_output | 19 + .../glean/tests/pytest/pings_test_output_cpp | 7 + .../glean/tests/pytest/pings_test_output_js_cpp | 10 +- .../glean/tests/pytest/pings_test_output_js_h | 2 +- toolkit/components/glean/tests/test_metrics.yaml | 19 + toolkit/components/glean/tests/test_pings.yaml | 19 + toolkit/components/glean/tests/xpcshell/head.js | 152 +++++ .../components/glean/tests/xpcshell/test_GIFFT.js | 10 +- .../glean/tests/xpcshell/test_GIFFTIPC.js | 7 +- .../components/glean/tests/xpcshell/test_Glean.js | 118 +++- .../glean/tests/xpcshell/test_GleanIPC.js | 5 +- .../components/glean/tests/xpcshell/test_JOG.js | 27 +- .../components/glean/tests/xpcshell/test_JOGIPC.js | 5 +- .../components/glean/tests/xpcshell/test_OHTTP.js | 32 + .../components/glean/tests/xpcshell/xpcshell.toml | 3 + toolkit/components/glean/xpcom/FOG.cpp | 7 +- toolkit/components/glean/xpcom/nsIFOG.idl | 3 + toolkit/components/kvstore/kvstore.sys.mjs | 24 +- toolkit/components/kvstore/nsIKeyValue.idl | 16 +- toolkit/components/kvstore/src/lib.rs | 44 +- toolkit/components/kvstore/src/task.rs | 26 +- .../kvstore/test/xpcshell/test_kvstore.js | 74 ++- .../lib/SpecialMessageActions.sys.mjs | 1 + .../schemas/TriggerActionSchemas/index.md | 2 +- .../components/messaging-system/schemas/index.rst | 4 +- toolkit/components/ml/actors/MLEngineChild.sys.mjs | 325 +++++++++ .../components/ml/actors/MLEngineParent.sys.mjs | 403 ++++++++++++ toolkit/components/ml/actors/moz.build | 8 + .../components/ml/content/EngineProcess.sys.mjs | 241 +++++++ toolkit/components/ml/content/MLEngine.html | 16 + toolkit/components/ml/content/MLEngine.worker.mjs | 91 +++ .../components/ml/content/SummarizerModel.sys.mjs | 160 +++++ toolkit/components/ml/docs/index.md | 44 ++ toolkit/components/ml/jar.mn | 9 + toolkit/components/ml/moz.build | 17 + toolkit/components/ml/tests/browser/browser.toml | 5 + .../ml/tests/browser/browser_ml_engine.js | 219 +++++++ toolkit/components/ml/tests/browser/head.js | 155 +++++ toolkit/components/moz.build | 1 + toolkit/components/mozintl/mozIntl.sys.mjs | 2 +- toolkit/components/mozintl/test/test_mozintl.js | 8 +- toolkit/components/narrate/NarrateControls.sys.mjs | 92 ++- .../narrate/test/browser_narrate_toggle.js | 25 +- toolkit/components/nimbus/FeatureManifest.yaml | 321 +++++++-- .../nimbus/generate/generate_feature_manifest.py | 25 +- .../nimbus/lib/ExperimentManager.sys.mjs | 76 ++- .../components/nimbus/lib/ExperimentStore.sys.mjs | 2 +- .../lib/RemoteSettingsExperimentLoader.sys.mjs | 2 +- toolkit/components/nimbus/metrics.yaml | 38 +- .../nimbus/schemas/ExperimentFeature.schema.json | 125 ++++ .../schemas/ExperimentFeatureManifest.schema.json | 123 +--- .../test/unit/test_ExperimentManager_unenroll.js | 112 ++++ .../nimbus/test/unit/test_SharedDataMap.js | 5 +- toolkit/components/normandy/Normandy.sys.mjs | 2 +- .../components/normandy/actions/BaseAction.sys.mjs | 2 +- .../actions/BranchedAddonStudyAction.sys.mjs | 2 +- .../actions/PreferenceExperimentAction.sys.mjs | 2 +- .../normandy/actions/ShowHeartbeatAction.sys.mjs | 5 +- .../components/normandy/lib/AddonStudies.sys.mjs | 2 +- .../normandy/lib/LegacyHeartbeat.sys.mjs | 1 + .../normandy/lib/PreferenceExperiments.sys.mjs | 4 +- .../components/normandy/lib/RecipeRunner.sys.mjs | 4 +- .../test/browser/browser_ActionsManager.js | 2 +- .../normandy/test/browser/browser_BaseAction.js | 4 +- .../test/browser/browser_LegacyHeartbeat.js | 138 +++- .../test/browser/browser_PreferenceExperiments.js | 21 +- .../normandy/test/browser/browser_RecipeRunner.js | 12 +- .../browser_actions_BranchedAddonStudyAction.js | 2 +- .../browser_actions_PreferenceExperimentAction.js | 1 - .../normandy/test/unit/test_NormandyApi.js | 4 +- .../passwordmgr/LoginAutoComplete.sys.mjs | 2 +- toolkit/components/passwordmgr/LoginHelper.sys.mjs | 2 +- .../components/passwordmgr/LoginManager.shared.mjs | 2 +- .../components/passwordmgr/LoginManager.sys.mjs | 2 +- .../passwordmgr/LoginManagerAuthPrompter.sys.mjs | 6 +- .../passwordmgr/LoginManagerChild.sys.mjs | 48 +- .../passwordmgr/LoginManagerContextMenu.sys.mjs | 4 +- .../passwordmgr/LoginManagerPrompter.sys.mjs | 183 +++--- toolkit/components/passwordmgr/nsILoginInfo.idl | 6 - .../passwordmgr/nsILoginManagerAuthPrompter.idl | 5 - .../passwordmgr/nsILoginManagerPrompter.idl | 5 - .../passwordmgr/storage-geckoview.sys.mjs | 14 +- .../passwordmgr/test/browser/browser.toml | 49 +- .../browser_autocomplete_primary_password.js | 2 +- .../test/browser/browser_basicAuth_rateLimit.js | 16 +- .../test/browser/browser_deleteLoginsBackup.js | 2 +- .../test/browser/browser_doorhanger_crossframe.js | 2 +- .../browser_doorhanger_generated_password.js | 4 +- .../test/browser/browser_doorhanger_remembering.js | 52 +- .../test/browser/browser_doorhanger_window_open.js | 4 +- .../test/browser/browser_entry_point_telemetry.js | 2 +- .../test/browser/browser_formless_submit_chrome.js | 10 +- .../test/browser/browser_message_onFormSubmit.js | 2 +- .../test/browser/browser_preselect_login.js | 2 +- .../test/browser/browser_proxyAuth_prompt.js | 8 +- .../test/browser/browser_relay_telemetry.js | 2 +- .../browser_username_only_form_telemetry.js | 14 +- .../passwordmgr/test/mochitest/pwmgr_common.js | 25 +- .../test/mochitest/pwmgr_common_parent.js | 6 +- .../mochitest/test_autofill_https_downgrade.html | 2 +- .../test/mochitest/test_bug_627616.html | 46 +- .../test_dismissed_doorhanger_in_shadow_DOM.html | 8 +- .../test_formLike_rootElement_with_Shadow_DOM.html | 8 +- .../test/mochitest/test_formless_autofill.html | 2 +- .../test_formless_submit_form_removal.html | 14 +- ...test_formless_submit_form_removal_negative.html | 4 +- .../mochitest/test_formless_submit_navigation.html | 6 +- .../test_formless_submit_navigation_negative.html | 10 +- .../test/mochitest/test_munged_values.html | 8 +- .../mochitest/test_one_doorhanger_per_un_pw.html | 5 +- .../test/mochitest/test_password_length.html | 12 +- .../test/mochitest/test_prompt_async.html | 6 +- .../mochitest/test_prompt_promptAuth_proxy.html | 6 +- .../test_submit_without_field_modifications.html | 8 +- .../passwordmgr/test/mochitest/test_xhr.html | 2 +- ...ginManagerParent_onPasswordEditedOrGenerated.js | 11 +- .../passwordmgr/test/unit/test_logins_change.js | 2 +- .../pdfjs/content/GeckoViewPdfjsChild.sys.mjs | 4 +- .../pdfjs/content/GeckoViewPdfjsParent.sys.mjs | 18 +- .../pdfjs/content/PdfJsDefaultPreferences.sys.mjs | 1 + .../pdfjs/content/PdfStreamConverter.sys.mjs | 49 +- .../components/pdfjs/content/PdfjsChild.sys.mjs | 19 +- toolkit/components/pdfjs/content/build/pdf.mjs | 726 ++++++++++++++++----- .../pdfjs/content/build/pdf.scripting.mjs | 4 +- .../components/pdfjs/content/build/pdf.worker.mjs | 114 +++- .../web/images/gv-toolbarButton-openinapp.svg | 11 - .../pdfjs/content/web/viewer-geckoview.css | 8 - .../pdfjs/content/web/viewer-geckoview.html | 3 - .../pdfjs/content/web/viewer-geckoview.mjs | 439 +++++++------ toolkit/components/pdfjs/content/web/viewer.css | 292 ++++++++- toolkit/components/pdfjs/content/web/viewer.html | 19 +- toolkit/components/pdfjs/content/web/viewer.mjs | 451 +++++++------ toolkit/components/pdfjs/jar.mn | 1 - toolkit/components/pdfjs/moz.yaml | 4 +- toolkit/components/pdfjs/test/browser.toml | 2 + .../test/browser_pdfjs_caret_browsing_mode.js | 82 +++ .../pdfjs/test/browser_pdfjs_download_button.js | 2 +- .../test/browser_pdfjs_editing_contextmenu.js | 140 ++-- .../pdfjs/test/browser_pdfjs_nonpdf_filename.js | 2 +- .../pdfjs/test/browser_pdfjs_octet_stream.js | 2 +- .../components/pdfjs/test/browser_pdfjs_saveas.js | 2 +- .../pdfjs/test/browser_pdfjs_stamp_telemetry.js | 2 +- toolkit/components/pdfjs/test/head.js | 22 + .../components/pictureinpicture/content/player.js | 14 +- .../pictureinpicture/content/player.xhtml | 1 + .../tests/browser_cannotTriggerFromContent.js | 2 +- .../browser_closePip_pageNavigationChanges.js | 4 +- .../tests/browser_preserveTabPipIconOverlay.js | 4 +- .../tests/browser_removeVideoElement.js | 2 +- .../pictureinpicture/tests/browser_reversePiP.js | 25 +- .../tests/browser_touch_toggle_enablepip.js | 2 +- .../components/places/BookmarkHTMLUtils.sys.mjs | 2 +- .../components/places/BookmarkJSONUtils.sys.mjs | 23 +- toolkit/components/places/BookmarkList.sys.mjs | 262 ++++++++ toolkit/components/places/Bookmarks.sys.mjs | 158 ++--- toolkit/components/places/Database.cpp | 20 +- toolkit/components/places/Database.h | 1 + toolkit/components/places/Helpers.cpp | 22 + toolkit/components/places/Helpers.h | 8 + toolkit/components/places/History.cpp | 78 ++- toolkit/components/places/History.sys.mjs | 27 +- toolkit/components/places/PlacesBackups.sys.mjs | 2 +- toolkit/components/places/PlacesDBUtils.sys.mjs | 4 +- toolkit/components/places/PlacesExpiration.sys.mjs | 4 +- .../places/PlacesFrecencyRecalculator.sys.mjs | 55 +- toolkit/components/places/PlacesPreviews.sys.mjs | 43 +- toolkit/components/places/PlacesSyncUtils.sys.mjs | 4 +- .../components/places/PlacesTransactions.sys.mjs | 8 +- toolkit/components/places/PlacesUtils.sys.mjs | 81 +-- toolkit/components/places/SQLFunctions.cpp | 20 +- toolkit/components/places/SQLFunctions.h | 8 +- toolkit/components/places/Shutdown.h | 4 +- .../places/SyncedBookmarksMirror.sys.mjs | 2 +- toolkit/components/places/TaggingService.sys.mjs | 2 +- toolkit/components/places/moz.build | 1 + toolkit/components/places/mozIAsyncHistory.idl | 4 +- toolkit/components/places/nsFaviconService.cpp | 64 +- toolkit/components/places/nsINavHistoryService.idl | 2 +- toolkit/components/places/nsITaggingService.idl | 6 - toolkit/components/places/nsPlacesTriggers.h | 2 +- .../places/tests/PlacesTestUtils.sys.mjs | 22 +- .../test_818584-discard-duplicate-backups.js | 2 +- .../bookmarks/test_818593-store-backup-metadata.js | 4 +- .../bookmarks/test_insert_thousands_bookmarks.js | 24 + .../places/tests/bookmarks/xpcshell.toml | 2 + .../components/places/tests/browser/browser.toml | 4 + .../tests/browser/browser_double_redirect.js | 2 +- .../places/tests/browser/browser_favicon.js | 74 +++ .../browser_favicon_privatebrowsing_perwindowpb.js | 2 +- .../places/tests/browser/browser_history_post.js | 2 +- .../places/tests/browser/browser_notfound.js | 2 +- .../places/tests/browser/browser_redirect_self.js | 2 +- .../tests/browser/browser_visited_notfound.js | 2 +- .../places/tests/browser/browser_visituri.js | 238 +++++-- ...browser_visituri_privatebrowsing_perwindowpb.js | 2 +- .../components/places/tests/browser/favicon.html | 5 +- .../places/tests/browser/previews/browser.toml | 2 +- .../components/places/tests/browser/userpass.html | 13 + .../places/tests/chrome/test_371798.xhtml | 2 +- .../places/tests/expiration/test_notifications.js | 2 +- .../places/tests/favicons/head_favicons.js | 11 +- .../favicons/test_cached-favicon_mime_type.js | 60 +- .../tests/favicons/test_page-icon_protocol.js | 62 +- .../favicons/test_setAndFetchFaviconForPage.js | 16 +- .../places/tests/history/test_async_history_api.js | 10 +- .../places/tests/history/test_insertMany.js | 21 +- .../places/tests/history/test_removeByFilter.js | 4 +- .../tests/history/test_removeVisitsByFilter.js | 2 +- .../tests/history/test_updatePlaces_embed.js | 8 +- .../places/tests/migration/places_v75.sqlite | Bin 1507328 -> 0 bytes .../places/tests/migration/places_v77.sqlite | Bin 0 -> 1507328 bytes .../tests/migration/test_current_from_v74.js | 26 +- .../places/tests/migration/xpcshell.toml | 2 +- toolkit/components/places/tests/moz.build | 1 + .../components/places/tests/queries/test_async.js | 2 +- .../queries/test_containersQueries_sorting.js | 4 +- .../tests/queries/test_querySerialization.js | 46 +- .../places/tests/queries/test_redirects.js | 4 +- .../components/places/tests/queries/test_tags.js | 6 +- toolkit/components/places/tests/sync/head_sync.js | 6 +- .../tests/sync/test_bookmark_abort_merging.js | 4 +- .../tests/sync/test_bookmark_observer_recorder.js | 4 +- .../tests/unit/test_asyncExecuteLegacyQueries.js | 4 +- .../places/tests/unit/test_async_transactions.js | 2 +- .../places/tests/unit/test_bookmark_list.js | 115 ++++ .../places/tests/unit/test_bookmarks_html.js | 2 +- .../tests/unit/test_bookmarks_html_corrupt.js | 2 +- .../unit/test_bookmarks_restore_notification.js | 2 +- .../places/tests/unit/test_frecency_decay.js | 2 +- .../places/tests/unit/test_nsINavHistoryViewer.js | 8 +- .../components/places/tests/unit/test_origins.js | 79 ++- .../places/tests/unit/test_origins_parsing.js | 11 +- .../tests/unit/test_tag_autocomplete_search.js | 2 +- toolkit/components/places/tests/unit/xpcshell.toml | 2 + toolkit/components/printing/content/print.js | 2 +- .../printing/tests/browser_preview_navigation.js | 2 +- toolkit/components/printing/tests/head.js | 4 +- toolkit/components/processtools/ProcInfo.h | 12 +- toolkit/components/processtools/ProcInfo.mm | 45 +- toolkit/components/processtools/moz.build | 2 +- .../components/promiseworker/PromiseWorker.sys.mjs | 175 +++-- .../promiseworker/tests/xpcshell/data/worker.js | 13 +- .../promiseworker/tests/xpcshell/test_Promise.js | 48 +- .../worker/PromiseWorker.template.worker.js | 40 +- .../components/prompts/content/commonDialog.css | 9 - toolkit/components/prompts/content/commonDialog.js | 1 - .../components/prompts/content/commonDialog.xhtml | 10 - .../prompts/docs/nsIPromptService-reference.rst | 2 +- .../components/prompts/src/CommonDialog.sys.mjs | 4 - toolkit/components/prompts/src/Prompter.sys.mjs | 5 +- .../prompts/test/PromptTestUtils.sys.mjs | 112 +--- toolkit/components/prompts/test/chromeScript.js | 40 +- toolkit/components/prompts/test/prompt_common.js | 19 +- toolkit/components/remote/nsDBusRemoteServer.cpp | 10 +- toolkit/components/remote/nsDBusRemoteServer.h | 2 +- .../reportbrokensite/ReportBrokenSiteChild.sys.mjs | 118 +--- .../ReportBrokenSiteParent.sys.mjs | 310 +++++---- .../reputationservice/ApplicationReputation.cpp | 28 +- .../reputationservice/ApplicationReputation.h | 4 +- .../resistfingerprinting/RFPHelper.sys.mjs | 2 +- .../components/resistfingerprinting/metrics.yaml | 384 +++++++++++ toolkit/components/resistfingerprinting/moz.build | 12 + .../resistfingerprinting/nsRFPService.cpp | 38 ++ .../resistfingerprinting/nsUserCharacteristics.cpp | 297 +++++++++ .../resistfingerprinting/nsUserCharacteristics.h | 28 + toolkit/components/resistfingerprinting/pings.yaml | 19 + .../resistfingerprinting/tests/gtest/moz.build | 1 + .../tests/gtest/test_usercharping.cpp | 143 ++++ .../components/satchel/FormHandlerChild.sys.mjs | 72 ++ .../components/satchel/FormHistoryChild.sys.mjs | 7 +- .../components/satchel/FormHistoryStartup.sys.mjs | 2 +- toolkit/components/satchel/moz.build | 1 + .../components/satchel/nsFormFillController.cpp | 2 +- .../satchel/test/browser/browser_close_tab.js | 5 +- .../browser/browser_privbrowsing_perwindowpb.js | 2 +- .../satchel/test/test_form_submission.html | 16 +- .../satchel/test/test_popup_enter_event.html | 4 +- .../satchel/test/unit/test_db_corrupt.js | 2 +- .../search/AppProvidedSearchEngine.sys.mjs | 185 ++++-- toolkit/components/search/SearchEngine.sys.mjs | 4 +- toolkit/components/search/SearchService.sys.mjs | 207 +++--- .../search/SearchSuggestionController.sys.mjs | 4 +- toolkit/components/search/SearchUtils.sys.mjs | 4 +- toolkit/components/search/nsISearchService.idl | 2 +- .../schema/search-config-overrides-ui-schema.json | 3 + .../schema/search-config-overrides-v2-schema.json | 1 + .../search-config-overrides-v2-ui-schema.json | 9 + ...earch-default-override-allowlist-ui-schema.json | 2 +- .../search/tests/SearchTestUtils.sys.mjs | 10 +- .../data/search-config-v2-no-order-hint.json | 207 ++++++ .../tests/xpcshell/data/search-config-v2.json | 223 +++++++ .../method-extensions/search-config-v2.json | 83 +++ .../test_searchconfig_ui_schemas_valid.js | 36 + .../searchconfigs/test_searchconfig_validates.js | 191 +++--- .../searchconfigs/test_searchicons_validates.js | 20 - .../tests/xpcshell/searchconfigs/xpcshell.toml | 16 +- .../xpcshell/test-extensions/search-config-v2.json | 139 ++++ .../tests/xpcshell/test_appProvided_icons.js | 211 ++++++ .../tests/xpcshell/test_defaultPrivateEngine.js | 4 +- .../search/tests/xpcshell/test_engine_ids.js | 49 +- .../search/tests/xpcshell/test_engine_set_alias.js | 2 +- .../xpcshell/test_getSubmission_params_pref.js | 9 +- .../test_getSubmission_params_prefNimbus.js | 17 +- ...test_getSubmission_params_prefNimbus_invalid.js | 5 +- .../search/tests/xpcshell/test_initialization.js | 51 +- .../xpcshell/test_initialization_with_region.js | 87 ++- .../tests/xpcshell/test_maybereloadengine_order.js | 54 +- .../search/tests/xpcshell/test_missing_engine.js | 52 +- .../search/tests/xpcshell/test_opensearch_icon.js | 18 +- .../xpcshell/test_opensearch_icons_invalid.js | 6 +- .../xpcshell/test_override_allowlist_switch.js | 12 +- .../search/tests/xpcshell/test_reload_engines.js | 322 ++++++++- .../xpcshell/test_reload_engines_experiment.js | 126 +++- .../tests/xpcshell/test_reload_engines_locales.js | 93 ++- .../test_remove_engine_notification_box.js | 112 +++- .../search/tests/xpcshell/test_searchSuggest.js | 2 +- .../tests/xpcshell/test_searchSuggest_cookies.js | 2 +- .../xpcshell/test_searchSuggest_extraParams.js | 56 +- .../tests/xpcshell/test_searchTermFromResult.js | 169 +++-- .../search/tests/xpcshell/test_settings_persist.js | 62 +- .../tests/xpcshell/test_sort_orders-no-hints.js | 8 +- .../tests/xpcshell/test_telemetry_event_default.js | 206 +++++- .../search/tests/xpcshell/test_validate_engines.js | 56 +- .../tests/xpcshell/test_webextensions_install.js | 22 +- .../test_webextensions_startup_duplicate.js | 6 +- .../components/search/tests/xpcshell/xpcshell.toml | 13 +- .../sessionstore/SessionStoreChangeListener.cpp | 11 +- .../components/taskscheduler/TaskScheduler.sys.mjs | 2 +- .../taskscheduler/TaskSchedulerMacOSImpl.sys.mjs | 2 +- .../taskscheduler/TaskSchedulerWinImpl.sys.mjs | 2 +- toolkit/components/telemetry/Events.yaml | 48 +- toolkit/components/telemetry/Histograms.json | 94 +-- toolkit/components/telemetry/Scalars.yaml | 40 +- .../components/telemetry/TelemetryStartup.sys.mjs | 4 +- .../app/TelemetryControllerContent.sys.mjs | 2 +- .../telemetry/app/TelemetryEnvironment.sys.mjs | 2 +- .../telemetry/app/TelemetryReportingPolicy.sys.mjs | 5 +- .../telemetry/app/TelemetryScheduler.sys.mjs | 2 +- .../telemetry/app/TelemetryStorage.sys.mjs | 6 +- .../telemetry/dap/DAPTelemetrySender.sys.mjs | 2 +- .../telemetry/dap/DAPVisitCounter.sys.mjs | 2 +- .../components/telemetry/docs/data/health-ping.rst | 2 +- .../telemetry/docs/obsolete/fhr/architecture.rst | 6 +- .../telemetry/docs/obsolete/fhr/dataformat.rst | 2 +- .../components/telemetry/pings/EventPing.sys.mjs | 2 +- .../telemetry/pings/TelemetrySession.sys.mjs | 2 +- .../tests/browser/browser_DynamicScalars.js | 2 +- .../telemetry/tests/integration/tests/conftest.py | 8 +- .../marionette/harness/telemetry_harness/runner.py | 3 + .../harness/telemetry_harness/testcase.py | 12 +- .../tests/client/test_deletion_request_ping.py | 4 +- .../tests/client/test_main_tab_scalars.py | 4 +- .../data/search-extensions/search-config-v2.json | 40 ++ toolkit/components/telemetry/tests/unit/head.js | 6 +- .../telemetry/tests/unit/test_EventPing.js | 8 +- .../tests/unit/test_TelemetryController.js | 2 +- .../tests/unit/test_TelemetryEnvironment.js | 17 +- .../tests/unit/test_TelemetryEnvironment_search.js | 13 +- .../telemetry/tests/unit/test_TelemetryEvents.js | 2 +- .../tests/unit/test_TelemetryHistograms.js | 6 +- .../tests/unit/test_TelemetryLateWrites.js | 8 +- .../tests/unit/test_TelemetrySendOldPings.js | 2 +- .../telemetry/tests/unit/test_TelemetrySession.js | 10 +- .../components/telemetry/tests/unit/xpcshell.toml | 1 + toolkit/components/terminator/nsTerminator.cpp | 6 +- .../tooltiptext/TooltipTextProvider.sys.mjs | 227 +++---- toolkit/components/tooltiptext/tests/browser.toml | 2 + .../tests/browser_input_file_tooltips.js | 4 +- .../tooltiptext/tests/browser_nac_tooltip.js | 66 ++ .../tests/browser_shadow_dom_tooltip.js | 2 +- .../translations/TranslationsTelemetry.sys.mjs | 3 + .../actors/AboutTranslationsChild.sys.mjs | 12 +- .../actors/AboutTranslationsParent.sys.mjs | 6 +- .../translations/actors/TranslationsChild.sys.mjs | 1 + .../actors/TranslationsEngineChild.sys.mjs | 6 +- .../actors/TranslationsEngineParent.sys.mjs | 13 +- .../translations/actors/TranslationsParent.sys.mjs | 219 +++---- .../content/translations-document.sys.mjs | 74 ++- .../content/translations-engine.sys.mjs | 8 +- .../translations/content/translations.mjs | 7 +- .../browser_translations_translation_document.js | 100 +++ .../translations/tests/browser/shared-head.js | 142 ++-- .../tests/browser/translations-test.mjs | 2 +- toolkit/components/translations/translations.d.ts | 2 +- toolkit/components/uniffi-js/UniFFIPointer.cpp | 38 +- .../UrlClassifierHashCompleter.sys.mjs | 4 +- .../url-classifier/UrlClassifierLib.sys.mjs | 2 +- .../UrlClassifierListManager.sys.mjs | 2 +- .../UrlClassifierRemoteSettingsService.sys.mjs | 2 +- .../url-classifier/nsIUrlListManager.idl | 2 +- .../tests/UrlClassifierTestUtils.sys.mjs | 8 +- .../tests/mochitest/allowlistAnnotatedFrame.html | 2 +- .../tests/mochitest/classifiedAnnotatedFrame.html | 2 +- .../tests/mochitest/classifierCommon.js | 6 +- .../tests/mochitest/classifierHelper.js | 4 +- .../url-classifier/tests/mochitest/dnt.html | 2 +- .../url-classifier/tests/mochitest/features.js | 2 +- .../url-classifier/tests/mochitest/head.js | 2 +- .../tests/mochitest/test_bug1254766.html | 4 +- .../tests/mochitest/test_cachemiss.html | 4 +- .../mochitest/test_classified_annotations.html | 2 +- .../mochitest/test_classifier_changetablepref.html | 6 +- .../tests/mochitest/test_classify_by_default.html | 2 +- .../tests/mochitest/test_classify_ping.html | 6 +- .../mochitest/test_classify_top_sandboxed.html | 2 +- .../tests/mochitest/test_classify_track.html | 6 +- .../tests/mochitest/test_donottrack.html | 2 +- .../tests/mochitest/test_gethash.html | 2 +- .../test_privatebrowsing_trackingprotection.html | 2 +- .../tests/mochitest/test_reporturl.html | 4 +- .../tests/mochitest/test_threathit_report.html | 4 +- .../test_trackingprotection_bug1312515.html | 8 +- .../test_trackingprotection_bug1580416.html | 2 +- .../test_trackingprotection_whitelist.html | 2 +- .../tests/mochitest/workerFrame.html | 10 +- .../tests/unit/head_urlclassifier.js | 10 +- .../tests/unit/test_channelClassifierService.js | 20 +- .../url-classifier/tests/unit/test_dbservice.js | 2 +- .../tests/unit/test_hashcompleter.js | 4 +- .../url-classifier/tests/unit/test_partial.js | 2 +- .../tests/unit/test_rsListService.js | 24 +- .../tests/unit/test_shouldclassify.js | 6 +- toolkit/components/utils/ClientEnvironment.sys.mjs | 2 +- toolkit/components/utils/FilterExpressions.sys.mjs | 6 +- .../components/utils/JsonSchemaValidator.sys.mjs | 2 +- toolkit/components/utils/moz.build | 2 +- toolkit/components/utils/mozjexl.js | 1 - toolkit/components/utils/mozjexl.sys.mjs | 1 + .../components/windowcreator/nsIWindowCreator.idl | 6 - toolkit/components/windowwatcher/moz.build | 1 - .../components/windowwatcher/nsIPromptService.idl | 2 +- .../components/windowwatcher/nsPIPromptService.idl | 30 - toolkit/content/aboutLogging.js | 6 +- toolkit/content/aboutNetError.mjs | 12 +- toolkit/content/aboutSupport.js | 2 +- toolkit/content/aboutSupport.xhtml | 4 +- toolkit/content/aboutwebrtc/aboutWebrtc.mjs | 2 +- toolkit/content/contentAreaUtils.js | 3 +- toolkit/content/customElements.js | 2 + toolkit/content/jar.mn | 5 + toolkit/content/license.html | 83 +-- .../content/tests/browser/browser_about_logging.js | 22 +- .../browser/browser_default_audio_filename.js | 2 +- .../browser/browser_default_image_filename.js | 2 +- .../browser_default_image_filename_redirect.js | 2 +- .../content/tests/browser/browser_saveImageURL.js | 2 +- .../browser_save_folder_standalone_image.js | 2 +- .../tests/browser/browser_save_resend_postdata.js | 2 +- .../content/tests/browser/datetime/browser.toml | 5 +- .../datetime/browser_datetime_change_event.js | 46 ++ toolkit/content/tests/browser/datetime/head.js | 12 +- toolkit/content/tests/chrome/chrome.toml | 2 + .../tests/chrome/test_autocomplete_mac_caret.xhtml | 4 +- .../chrome/test_menulist_initial_selection.xhtml | 55 ++ toolkit/content/tests/chrome/window_tooltip.xhtml | 6 +- .../test_autocomplete_change_after_focus.html | 2 +- toolkit/content/tests/widgets/chrome.toml | 5 + toolkit/content/tests/widgets/test_moz_button.html | 158 +++++ .../content/tests/widgets/test_moz_page_nav.html | 306 +++++++++ .../content/tests/widgets/test_videocontrols.html | 2 +- toolkit/content/widgets/arrowscrollbox.js | 15 +- toolkit/content/widgets/autocomplete-input.js | 10 +- toolkit/content/widgets/autocomplete-popup.js | 6 +- .../content/widgets/autocomplete-richlistitem.js | 4 +- toolkit/content/widgets/browser-custom-element.js | 4 +- toolkit/content/widgets/datetimebox.js | 2 +- toolkit/content/widgets/dialog.js | 4 +- toolkit/content/widgets/editor.js | 6 +- toolkit/content/widgets/findbar.js | 12 +- toolkit/content/widgets/menu.js | 2 +- toolkit/content/widgets/menulist.js | 3 + toolkit/content/widgets/menupopup.js | 23 +- .../widgets/moz-button-group/moz-button-group.mjs | 2 +- toolkit/content/widgets/moz-button/moz-button.css | 142 ++++ toolkit/content/widgets/moz-button/moz-button.mjs | 90 +++ .../widgets/moz-button/moz-button.stories.mjs | 100 +++ toolkit/content/widgets/moz-input-box.js | 2 +- .../content/widgets/moz-label/README.stories.md | 4 +- toolkit/content/widgets/moz-label/moz-label.mjs | 2 +- .../widgets/moz-message-bar/moz-message-bar.mjs | 2 +- .../moz-message-bar/moz-message-bar.stories.mjs | 6 + .../widgets/moz-page-nav/moz-page-nav-button.css | 123 ++++ .../content/widgets/moz-page-nav/moz-page-nav.css | 76 +++ .../content/widgets/moz-page-nav/moz-page-nav.mjs | 170 +++++ .../widgets/moz-page-nav/moz-page-nav.stories.mjs | 77 +++ .../widgets/moz-support-link/moz-support-link.mjs | 2 +- toolkit/content/widgets/moz-toggle/moz-toggle.css | 39 +- toolkit/content/widgets/named-deck.js | 2 +- toolkit/content/widgets/notificationbox.js | 2 +- .../content/widgets/panel-list/README.stories.md | 22 +- toolkit/content/widgets/panel-list/panel-list.css | 4 + toolkit/content/widgets/panel-list/panel-list.js | 59 +- .../widgets/panel-list/panel-list.stories.mjs | 45 +- toolkit/content/widgets/radio.js | 6 +- toolkit/content/widgets/richlistbox.js | 2 +- toolkit/content/widgets/search-textbox.js | 2 +- toolkit/content/widgets/tabbox.js | 8 +- toolkit/content/widgets/text.js | 2 +- toolkit/content/widgets/textrecognition.js | 2 +- toolkit/content/widgets/tree.js | 8 +- toolkit/content/widgets/videocontrols.js | 80 +-- toolkit/content/widgets/wizard.js | 2 +- toolkit/content/xul.css | 89 +-- toolkit/crashreporter/CrashAnnotations.h.in | 18 + .../linux/microdump_writer/microdump_writer.cc | 4 +- .../linux/minidump_writer/linux_dumper.cc | 12 +- .../linux/minidump_writer/linux_dumper.h | 9 +- .../linux/minidump_writer/minidump_writer.cc | 12 +- .../mac/handler/minidump_generator.cc | 15 +- .../mac/handler/minidump_generator.h | 3 +- toolkit/crashreporter/docs/index.rst | 5 +- toolkit/crashreporter/linux_utils.cc | 59 ++ toolkit/crashreporter/linux_utils.h | 16 + toolkit/crashreporter/moz.build | 8 + .../crashreporter/mozannotation_client/src/lib.rs | 257 +++++--- .../crashreporter/mozannotation_server/Cargo.toml | 1 - .../crashreporter/mozannotation_server/src/lib.rs | 66 +- .../src/process_reader/linux.rs | 4 +- toolkit/crashreporter/nsDummyExceptionHandler.cpp | 71 +- toolkit/crashreporter/nsExceptionHandler.cpp | 678 ++++++++++++------- toolkit/crashreporter/nsExceptionHandler.h | 47 +- .../crashreporter/test/gtest/TestElfSoVersion.cpp | 143 ++++ toolkit/crashreporter/test/gtest/moz.build | 16 + toolkit/crashreporter/test/moz.build | 4 + .../crashreporter/test/unit/head_crashreporter.js | 3 + .../test/unit/test_crash_modules_linux.js | 33 + toolkit/crashreporter/test/unit/xpcshell-phc.toml | 4 +- toolkit/crashreporter/test/unit/xpcshell.toml | 40 +- toolkit/crashreporter/tools/symbolstore.py | 2 +- toolkit/library/moz.build | 1 + toolkit/library/rust/moz.build | 3 + toolkit/library/rust/shared/Cargo.toml | 2 +- .../locales/en-US/chrome/global/narrate.properties | 6 +- .../toolkit/contentanalysis/contentanalysis.ftl | 20 +- .../en-US/toolkit/formautofill/formAutofill.ftl | 18 + .../en-US/toolkit/global/arrowscrollbox.ftl | 20 + .../locales/en-US/toolkit/global/processTypes.ftl | 7 + .../locales/en-US/toolkit/global/textActions.ftl | 3 + toolkit/locales/en-US/toolkit/pdfviewer/viewer.ftl | 17 +- toolkit/modules/ActorManagerParent.sys.mjs | 29 +- toolkit/modules/AppConstants.sys.mjs | 23 +- toolkit/modules/BrowserUtils.sys.mjs | 1 + toolkit/modules/ClipboardContextMenu.sys.mjs | 10 +- toolkit/modules/Console.sys.mjs | 2 +- toolkit/modules/DateTimePickerPanel.sys.mjs | 2 - toolkit/modules/Deprecated.sys.mjs | 81 --- toolkit/modules/FindBarContent.sys.mjs | 9 +- toolkit/modules/FirstStartup.sys.mjs | 26 +- toolkit/modules/ObjectUtils.sys.mjs | 16 + toolkit/modules/ProcessType.sys.mjs | 11 + toolkit/modules/RemotePageAccessManager.sys.mjs | 5 +- toolkit/modules/Sqlite.sys.mjs | 158 ++--- toolkit/modules/Troubleshoot.sys.mjs | 20 + toolkit/modules/docs/AsyncShutdown.rst | 8 +- toolkit/modules/metrics.yaml | 20 + toolkit/modules/moz.build | 2 +- toolkit/modules/subprocess/.eslintrc.js | 4 - toolkit/modules/tests/browser/browser.toml | 2 - .../modules/tests/browser/browser_Deprecated.js | 140 ---- toolkit/modules/tests/marionette/manifest.toml | 4 + .../modules/tests/marionette/test_first_startup.py | 54 ++ .../tests/xpcshell/test_GMPInstallManager.js | 2 +- toolkit/modules/tests/xpcshell/test_Services.js | 1 - .../modules/tests/xpcshell/test_firstStartup.js | 25 +- toolkit/modules/tests/xpcshell/test_sqlite.js | 5 +- toolkit/modules/third_party/fathom/README | 2 +- toolkit/modules/third_party/fathom/fathom.mjs | 2 +- toolkit/moz.configure | 199 +++--- .../BackgroundTask_defaultagent.sys.mjs | 45 +- toolkit/mozapps/defaultagent/DefaultAgent.cpp | 59 -- toolkit/mozapps/defaultagent/DefaultBrowser.cpp | 11 - toolkit/mozapps/defaultagent/DefaultBrowser.h | 4 - toolkit/mozapps/defaultagent/Notification.cpp | 602 +---------------- toolkit/mozapps/defaultagent/Notification.h | 7 +- toolkit/mozapps/defaultagent/ScheduledTask.cpp | 3 - toolkit/mozapps/defaultagent/SetDefaultBrowser.cpp | 393 ++++++++++- toolkit/mozapps/defaultagent/defaultagent.ini | 9 - toolkit/mozapps/defaultagent/moz.build | 20 +- toolkit/mozapps/defaultagent/nsIDefaultAgent.idl | 14 - toolkit/mozapps/defaultagent/proxy/main.cpp | 2 - toolkit/mozapps/defaultagent/proxy/moz.build | 1 - toolkit/mozapps/downloads/DownloadLastDir.sys.mjs | 2 +- toolkit/mozapps/downloads/DownloadUtils.sys.mjs | 2 +- toolkit/mozapps/downloads/HelperAppDlg.sys.mjs | 32 +- .../tests/browser/browser_save_wrongextension.js | 2 +- .../browser_unknownContentType_delayedbutton.js | 6 +- .../browser_unknownContentType_dialog_layout.js | 4 +- .../downloads/tests/unit/test_lowMinutes.js | 2 +- toolkit/mozapps/extensions/AddonManager.sys.mjs | 4 +- toolkit/mozapps/extensions/content/aboutaddons.css | 12 +- toolkit/mozapps/extensions/content/aboutaddons.js | 27 +- .../extensions/content/aboutaddonsCommon.js | 6 +- .../extensions/internal/AddonRepository.sys.mjs | 2 +- .../extensions/internal/AddonTestUtils.sys.mjs | 31 +- .../extensions/internal/AddonUpdateChecker.sys.mjs | 2 +- .../internal/SitePermsAddonProvider.sys.mjs | 23 +- .../extensions/internal/XPIDatabase.sys.mjs | 2 +- .../mozapps/extensions/internal/XPIInstall.sys.mjs | 33 +- .../extensions/internal/XPIProvider.sys.mjs | 2 +- .../mozapps/extensions/test/browser/browser.toml | 2 + .../test/browser/browser_html_options_ui.js | 11 +- .../browser/browser_page_options_install_addon.js | 2 +- .../browser/browser_sidebar_preferences_button.js | 73 +++ .../extensions/test/xpcshell/test_corrupt.js | 4 +- .../test_system_update_enterprisepolicy.js | 26 +- toolkit/mozapps/handling/content/appChooser.js | 2 +- toolkit/mozapps/installer/packager.py | 2 +- toolkit/mozapps/update/AppUpdater.sys.mjs | 14 - toolkit/mozapps/update/BackgroundUpdate.sys.mjs | 2 +- toolkit/mozapps/update/UpdateService.sys.mjs | 28 +- toolkit/mozapps/update/UpdateTelemetry.sys.mjs | 2 +- toolkit/mozapps/update/common/updatererrors.h | 18 +- toolkit/mozapps/update/docs/BackgroundUpdates.rst | 6 +- .../tests/browser/browser_elevationDialog.js | 4 +- toolkit/mozapps/update/tests/browser/head.js | 2 +- toolkit/mozapps/update/tests/data/app_update.sjs | 4 +- toolkit/mozapps/update/tests/data/shared.js | 2 +- .../mozapps/update/tests/data/xpcshellUtilsAUS.js | 14 +- .../marionette/test_no_window_update_restart.py | 4 +- .../tests/unit_aus_update/languagePackUpdates.js | 6 +- .../update/tests/unit_aus_update/multiUpdate.js | 10 +- .../tests/unit_aus_update/updateSyncManager.js | 4 +- .../test_backgroundupdate_glean.js | 6 +- toolkit/mozapps/update/updater/updater.cpp | 2 +- toolkit/profile/content/createProfileWizard.js | 2 +- .../androidproxy/nsAndroidSystemProxySettings.cpp | 6 + .../system/osxproxy/nsOSXSystemProxySettings.mm | 11 + .../system/unixproxy/nsUnixSystemProxySettings.cpp | 6 + .../windowsproxy/nsWindowsSystemProxySettings.cpp | 13 + toolkit/themes/linux/global/global.css | 4 - toolkit/themes/osx/global/global.css | 6 - .../design-system/README.design-tokens.stories.md | 44 +- .../themes/shared/design-system/tokens-brand.css | 55 +- .../shared/design-system/tokens-platform.css | 13 +- .../themes/shared/design-system/tokens-shared.css | 392 +++++++---- toolkit/themes/shared/desktop-jar.inc.mn | 1 + toolkit/themes/shared/global-shared.css | 66 +- toolkit/themes/shared/icons/plus-20.svg | 4 + toolkit/themes/shared/in-content/common-shared.css | 7 +- toolkit/themes/shared/media/pause-fill.svg | 5 +- toolkit/themes/shared/media/videocontrols.css | 2 +- toolkit/themes/shared/popup.css | 89 ++- toolkit/themes/windows/global/global.css | 6 - .../dllservices/mozglue/WindowsDllBlocklist.cpp | 43 +- .../xre/dllservices/mozglue/WindowsDllBlocklist.h | 9 +- toolkit/xre/nsAppRunner.cpp | 199 +++--- toolkit/xre/nsAppRunner.h | 2 +- toolkit/xre/nsEmbedFunctions.cpp | 14 +- toolkit/xre/nsWindowsWMain.cpp | 23 + 1107 files changed, 22076 insertions(+), 9899 deletions(-) create mode 100644 toolkit/components/antitracking/bouncetrackingprotection/test/xpcshell/test_bouncetracking_clearExpiredUserActivation.js create mode 100644 toolkit/components/contentanalysis/tests/browser/browser.toml create mode 100644 toolkit/components/contentanalysis/tests/browser/browser_content_analysis_policies.js create mode 100644 toolkit/components/contentanalysis/tests/browser/moz.build delete mode 100644 toolkit/components/contentanalysis/tests/gtest/TestContentAnalysis.h create mode 100644 toolkit/components/contentanalysis/tests/gtest/TestContentAnalysisAgent.cpp create mode 100644 toolkit/components/contentanalysis/tests/gtest/TestContentAnalysisAgent.h create mode 100644 toolkit/components/contentanalysis/tests/moz.build delete mode 100644 toolkit/components/formautofill/AutofillTelemetry.sys.mjs delete mode 100644 toolkit/components/formautofill/phonenumberutils/PhoneNumber.sys.mjs delete mode 100644 toolkit/components/formautofill/phonenumberutils/PhoneNumberMetaData.sys.mjs delete mode 100644 toolkit/components/formautofill/phonenumberutils/PhoneNumberNormalizer.sys.mjs create mode 100644 toolkit/components/formautofill/shared/AddressRecord.sys.mjs create mode 100644 toolkit/components/formautofill/shared/AutofillTelemetry.sys.mjs create mode 100644 toolkit/components/formautofill/shared/PhoneNumber.sys.mjs create mode 100644 toolkit/components/formautofill/shared/PhoneNumberMetaData.sys.mjs create mode 100644 toolkit/components/formautofill/shared/PhoneNumberNormalizer.sys.mjs create mode 100644 toolkit/components/glean/api/src/ffi/object.rs create mode 100644 toolkit/components/glean/api/src/private/object.rs create mode 100644 toolkit/components/glean/bindings/private/Object.cpp create mode 100644 toolkit/components/glean/bindings/private/Object.h create mode 100644 toolkit/components/glean/build_scripts/glean_parser_ext/templates/ohttp.jinja2 create mode 100644 toolkit/components/glean/src/ohttp_pings.rs create mode 100644 toolkit/components/glean/tests/xpcshell/test_OHTTP.js create mode 100644 toolkit/components/ml/actors/MLEngineChild.sys.mjs create mode 100644 toolkit/components/ml/actors/MLEngineParent.sys.mjs create mode 100644 toolkit/components/ml/actors/moz.build create mode 100644 toolkit/components/ml/content/EngineProcess.sys.mjs create mode 100644 toolkit/components/ml/content/MLEngine.html create mode 100644 toolkit/components/ml/content/MLEngine.worker.mjs create mode 100644 toolkit/components/ml/content/SummarizerModel.sys.mjs create mode 100644 toolkit/components/ml/docs/index.md create mode 100644 toolkit/components/ml/jar.mn create mode 100644 toolkit/components/ml/moz.build create mode 100644 toolkit/components/ml/tests/browser/browser.toml create mode 100644 toolkit/components/ml/tests/browser/browser_ml_engine.js create mode 100644 toolkit/components/ml/tests/browser/head.js create mode 100644 toolkit/components/nimbus/schemas/ExperimentFeature.schema.json delete mode 100644 toolkit/components/pdfjs/content/web/images/gv-toolbarButton-openinapp.svg create mode 100644 toolkit/components/pdfjs/test/browser_pdfjs_caret_browsing_mode.js create mode 100644 toolkit/components/places/BookmarkList.sys.mjs create mode 100644 toolkit/components/places/tests/bookmarks/test_insert_thousands_bookmarks.js create mode 100644 toolkit/components/places/tests/browser/browser_favicon.js create mode 100644 toolkit/components/places/tests/browser/userpass.html delete mode 100644 toolkit/components/places/tests/migration/places_v75.sqlite create mode 100644 toolkit/components/places/tests/migration/places_v77.sqlite create mode 100644 toolkit/components/places/tests/unit/test_bookmark_list.js create mode 100644 toolkit/components/resistfingerprinting/nsUserCharacteristics.cpp create mode 100644 toolkit/components/resistfingerprinting/nsUserCharacteristics.h create mode 100644 toolkit/components/resistfingerprinting/pings.yaml create mode 100644 toolkit/components/resistfingerprinting/tests/gtest/test_usercharping.cpp create mode 100644 toolkit/components/satchel/FormHandlerChild.sys.mjs create mode 100644 toolkit/components/search/schema/search-config-overrides-ui-schema.json create mode 100644 toolkit/components/search/schema/search-config-overrides-v2-ui-schema.json create mode 100644 toolkit/components/search/tests/xpcshell/data/search-config-v2-no-order-hint.json create mode 100644 toolkit/components/search/tests/xpcshell/data/search-config-v2.json create mode 100644 toolkit/components/search/tests/xpcshell/method-extensions/search-config-v2.json create mode 100644 toolkit/components/search/tests/xpcshell/searchconfigs/test_searchconfig_ui_schemas_valid.js delete mode 100644 toolkit/components/search/tests/xpcshell/searchconfigs/test_searchicons_validates.js create mode 100644 toolkit/components/search/tests/xpcshell/test-extensions/search-config-v2.json create mode 100644 toolkit/components/search/tests/xpcshell/test_appProvided_icons.js create mode 100644 toolkit/components/telemetry/tests/unit/data/search-extensions/search-config-v2.json create mode 100644 toolkit/components/tooltiptext/tests/browser_nac_tooltip.js delete mode 100644 toolkit/components/utils/mozjexl.js create mode 100644 toolkit/components/utils/mozjexl.sys.mjs delete mode 100644 toolkit/components/windowwatcher/nsPIPromptService.idl create mode 100644 toolkit/content/tests/browser/datetime/browser_datetime_change_event.js create mode 100644 toolkit/content/tests/chrome/test_menulist_initial_selection.xhtml create mode 100644 toolkit/content/tests/widgets/test_moz_button.html create mode 100644 toolkit/content/tests/widgets/test_moz_page_nav.html create mode 100644 toolkit/content/widgets/moz-button/moz-button.css create mode 100644 toolkit/content/widgets/moz-button/moz-button.mjs create mode 100644 toolkit/content/widgets/moz-button/moz-button.stories.mjs create mode 100644 toolkit/content/widgets/moz-page-nav/moz-page-nav-button.css create mode 100644 toolkit/content/widgets/moz-page-nav/moz-page-nav.css create mode 100644 toolkit/content/widgets/moz-page-nav/moz-page-nav.mjs create mode 100644 toolkit/content/widgets/moz-page-nav/moz-page-nav.stories.mjs create mode 100644 toolkit/crashreporter/linux_utils.cc create mode 100644 toolkit/crashreporter/linux_utils.h create mode 100644 toolkit/crashreporter/test/gtest/TestElfSoVersion.cpp create mode 100644 toolkit/crashreporter/test/gtest/moz.build create mode 100644 toolkit/crashreporter/test/unit/test_crash_modules_linux.js create mode 100644 toolkit/locales/en-US/toolkit/global/arrowscrollbox.ftl delete mode 100644 toolkit/modules/Deprecated.sys.mjs delete mode 100644 toolkit/modules/tests/browser/browser_Deprecated.js create mode 100644 toolkit/modules/tests/marionette/manifest.toml create mode 100644 toolkit/modules/tests/marionette/test_first_startup.py delete mode 100644 toolkit/mozapps/defaultagent/defaultagent.ini create mode 100644 toolkit/mozapps/extensions/test/browser/browser_sidebar_preferences_button.js create mode 100644 toolkit/themes/shared/icons/plus-20.svg (limited to 'toolkit') diff --git a/toolkit/actors/AutoCompleteParent.sys.mjs b/toolkit/actors/AutoCompleteParent.sys.mjs index 27f3dcbe07..611677a84f 100644 --- a/toolkit/actors/AutoCompleteParent.sys.mjs +++ b/toolkit/actors/AutoCompleteParent.sys.mjs @@ -503,7 +503,8 @@ export class AutoCompleteParent extends JSWindowActorParent { * that the open popup should be focused. */ requestFocus() { - // Bug 1582722 - See the response in AutoCompleteChild.jsm for why this disabled. + // Bug 1582722 - See the response in AutoCompleteChild.sys.mjs for why this + // disabled. /* if (this.openedPopup) { this.sendAsyncMessage("FormAutoComplete:Focus"); diff --git a/toolkit/actors/AutoScrollChild.sys.mjs b/toolkit/actors/AutoScrollChild.sys.mjs index 25e2ae77a5..11324b4eaa 100644 --- a/toolkit/actors/AutoScrollChild.sys.mjs +++ b/toolkit/actors/AutoScrollChild.sys.mjs @@ -215,8 +215,14 @@ export class AutoScrollChild extends JSWindowActorChild { return; } - Services.els.addSystemEventListener(this.document, "mousemove", this, true); - Services.els.addSystemEventListener(this.document, "mouseup", this, true); + this.document.addEventListener("mousemove", this, { + capture: true, + mozSystemGroup: true, + }); + this.document.addEventListener("mouseup", this, { + capture: true, + mozSystemGroup: true, + }); this.document.addEventListener("pagehide", this, true); this._startX = event.screenX; @@ -254,18 +260,14 @@ export class AutoScrollChild extends JSWindowActorChild { this._scrollable.mozScrollSnap(); this._scrollable = null; - Services.els.removeSystemEventListener( - this.document, - "mousemove", - this, - true - ); - Services.els.removeSystemEventListener( - this.document, - "mouseup", - this, - true - ); + this.document.removeEventListener("mousemove", this, { + capture: true, + mozSystemGroup: true, + }); + this.document.removeEventListener("mouseup", this, { + capture: true, + mozSystemGroup: true, + }); this.document.removeEventListener("pagehide", this, true); if (this._autoscrollHandledByApz) { Services.obs.removeObserver( diff --git a/toolkit/actors/FindBarChild.sys.mjs b/toolkit/actors/FindBarChild.sys.mjs index 645456ad1f..8aed35a769 100644 --- a/toolkit/actors/FindBarChild.sys.mjs +++ b/toolkit/actors/FindBarChild.sys.mjs @@ -141,11 +141,8 @@ export class FindBarChild extends JSWindowActorChild { return false; } - if ( - (win.HTMLIFrameElement.isInstance(elt) && elt.mozbrowser) || - win.XULFrameElement.isInstance(elt) - ) { - // If we're targeting a mozbrowser iframe or an embedded XULFrameElement + if (win.XULFrameElement.isInstance(elt)) { + // If we're targeting an embedded XULFrameElement // (e.g. about:addons extensions inline options page), do not activate // fast find. return false; diff --git a/toolkit/actors/PictureInPictureChild.sys.mjs b/toolkit/actors/PictureInPictureChild.sys.mjs index 62dc6cdfff..2a415df32d 100644 --- a/toolkit/actors/PictureInPictureChild.sys.mjs +++ b/toolkit/actors/PictureInPictureChild.sys.mjs @@ -1225,11 +1225,11 @@ export class PictureInPictureToggleChild extends JSWindowActorChild { let shadowRoot = video.openOrClosedShadowRoot; if (shadowRoot.firstChild && video != oldOverVideo) { - if (video.getTransformToViewport().a == -1) { - shadowRoot.firstChild.setAttribute("flipped", true); - } else { - shadowRoot.firstChild.removeAttribute("flipped"); - } + // TODO: Maybe this should move to videocontrols.js somehow. + shadowRoot.firstChild.toggleAttribute( + "flipped", + video.getTransformToViewport().a == -1 + ); } // It seems from automated testing that if it's still very early on in the @@ -1812,7 +1812,7 @@ export class PictureInPictureChild extends JSWindowActorChild { * 4) all active cues with VTTCue.line integer have VTTCue.snapToLines = true * 5) all active cues with VTTCue.line percentage have VTTCue.snapToLines = false * - * vtt.jsm currently sets snapToLines to false if line is a percentage value, but + * vtt.sys.mjs currently sets snapToLines to false if line is a percentage value, but * cues are still ordered by line. In most cases, snapToLines is set to true by default, * unless intentionally overridden. * @param allCuesArray {Array} array of active cues diff --git a/toolkit/actors/SelectChild.sys.mjs b/toolkit/actors/SelectChild.sys.mjs index a6d96d1b79..1bc80001ae 100644 --- a/toolkit/actors/SelectChild.sys.mjs +++ b/toolkit/actors/SelectChild.sys.mjs @@ -15,7 +15,7 @@ ChromeUtils.defineESModuleGetters(lazy, { const kStateActive = 0x00000001; // ElementState::ACTIVE const kStateHover = 0x00000004; // ElementState::HOVER -// Duplicated in SelectParent.jsm +// Duplicated in SelectParent.sys.mjs // Please keep these lists in sync. const SUPPORTED_OPTION_OPTGROUP_PROPERTIES = [ "direction", @@ -277,7 +277,7 @@ SelectContentHelper.prototype = { InspectorUtils.removeContentState(this.element, kStateHover); break; - case "Forms:MouseUp": + case "Forms:MouseUp": { let win = this.element.ownerGlobal; if (message.data.onAnchor) { this.dispatchMouseEvent(win, this.element, "mouseup"); @@ -287,6 +287,7 @@ SelectContentHelper.prototype = { this.dispatchMouseEvent(win, this.element, "click"); } break; + } case "Forms:SearchFocused": this._closeAfterBlur = false; @@ -346,6 +347,13 @@ function getComputedStyles(element) { function supportedStyles(cs, supportedProps) { let styles = {}; for (let property of supportedProps) { + if (property == "font-size") { + let usedSize = cs.usedFontSize; + if (usedSize >= 0.0) { + styles[property] = usedSize + "px"; + continue; + } + } styles[property] = cs.getPropertyValue(property); } return styles; diff --git a/toolkit/actors/SelectParent.sys.mjs b/toolkit/actors/SelectParent.sys.mjs index 6d14807e44..5382b35ab3 100644 --- a/toolkit/actors/SelectParent.sys.mjs +++ b/toolkit/actors/SelectParent.sys.mjs @@ -32,7 +32,7 @@ const PROPERTIES_RESET_WHEN_ACTIVE = [ "text-shadow", ]; -// Duplicated in SelectChild.jsm +// Duplicated in SelectChild.sys.mjs // Please keep these lists in sync. const SUPPORTED_OPTION_OPTGROUP_PROPERTIES = [ "direction", diff --git a/toolkit/components/aboutconfig/content/aboutconfig.js b/toolkit/components/aboutconfig/content/aboutconfig.js index e11021ed64..5e67b764b5 100644 --- a/toolkit/components/aboutconfig/content/aboutconfig.js +++ b/toolkit/components/aboutconfig/content/aboutconfig.js @@ -255,6 +255,7 @@ class PrefRow { if (this.editing) { this.inputField = document.createElement("input"); this.inputField.value = this.value; + this.inputField.ariaLabel = this.name; if (this.type == "Number") { this.inputField.type = "number"; this.inputField.required = true; diff --git a/toolkit/components/aboutconfig/test/browser/browser.toml b/toolkit/components/aboutconfig/test/browser/browser.toml index acccf1f8f0..a0cce686b8 100644 --- a/toolkit/components/aboutconfig/test/browser/browser.toml +++ b/toolkit/components/aboutconfig/test/browser/browser.toml @@ -11,10 +11,9 @@ support-files = ["head.js"] ["browser_basic.js"] ["browser_clipboard.js"] -fail-if = ["a11y_checks"] # Bug 1854447 th, td.cell-value, #prefs may not be focusable; #show-all may be unlabeled ["browser_edit.js"] -fail-if = ["a11y_checks"] # Bug 1854447 span, th, td.cell-value may not be focusable; #show-all, input, button-add/delete/reset ghost-buttons may not be labeled +fail-if = ["a11y_checks"] # Bugs 1854447 and 1882380 span may not be focusable skip-if = ["os == 'linux' && ccov"] # Bug 1613515, the test consistently times out on Linux coverage builds. ["browser_locked.js"] diff --git a/toolkit/components/aboutconfig/test/browser/browser_clipboard.js b/toolkit/components/aboutconfig/test/browser/browser_clipboard.js index bcaa2c0328..a8fca568c7 100644 --- a/toolkit/components/aboutconfig/test/browser/browser_clipboard.js +++ b/toolkit/components/aboutconfig/test/browser/browser_clipboard.js @@ -33,6 +33,14 @@ add_task(async function test_copy() { let selectText = async target => { let { width, height } = target.getBoundingClientRect(); + + // We intentionally turn off this a11y check, because the following + // series of mouse events is purposefully targeting a non-interactive + // text content. This action does not require the element to have an + // interactive accessible to be done by assistive technology with caret + // browsing (when/if supported), this rule check shall be ignored by + // a11y_checks suite. + AccessibilityUtils.setEnv({ mustHaveAccessibleRule: false }); EventUtils.synthesizeMouse( target, 1, @@ -54,6 +62,7 @@ add_task(async function test_copy() { { type: "mouseup" }, this.browser.contentWindow ); + AccessibilityUtils.resetEnv(); }; // Drag across the name cell. @@ -107,6 +116,13 @@ add_task(async function test_copy_multiple() { let { width, height } = endRow.valueCell.getBoundingClientRect(); // Drag from the top left of the first row to the bottom right of the last. + // We intentionally turn off this a11y check, because the following + // series of mouse events is purposefully targeting a non-interactive + // text content. This action does not require the element to have an + // interactive accessible to be done by assistive technology with caret + // browsing (when/if supported), this rule check shall be ignored by + // a11y_checks suite. + AccessibilityUtils.setEnv({ mustHaveAccessibleRule: false }); EventUtils.synthesizeMouse( startRow.nameCell, 1, @@ -129,6 +145,7 @@ add_task(async function test_copy_multiple() { { type: "mouseup" }, this.browser.contentWindow ); + AccessibilityUtils.resetEnv(); await SimpleTest.promiseClipboardChange(expectedString, async () => { await BrowserTestUtils.synthesizeKey( diff --git a/toolkit/components/aboutconfig/test/browser/browser_edit.js b/toolkit/components/aboutconfig/test/browser/browser_edit.js index 9d10fb1e75..24fb168e76 100644 --- a/toolkit/components/aboutconfig/test/browser/browser_edit.js +++ b/toolkit/components/aboutconfig/test/browser/browser_edit.js @@ -282,6 +282,11 @@ add_task(async function test_edit_field_selected() { Assert.equal(row.value, startValue); row.editColumnButton.click(); Assert.equal(row.valueInput.value, startValue); + Assert.equal( + row.valueInput.getAttribute("aria-label"), + prefName, + "The input field is labeled from the pref name" + ); EventUtils.sendString(endValue, this.window); @@ -334,15 +339,31 @@ add_task(async function test_double_click_modify() { let click = (target, opts) => EventUtils.synthesizeMouseAtCenter(target, opts, this.window); let doubleClick = target => { + // We intentionally turn off this a11y check, because the following series + // of clicks (in these test cases) is either performing an activation of + // the edit mode for prefs or selecting a text in focused inputs. The + // edit mode can be activated with a separate "Edit" or "Toggle" button + // provided for each pref, and the text selection can be performed with + // caret browsing (when supported). Thus, this rule check can be ignored + // by a11y_checks suite. + AccessibilityUtils.setEnv({ mustHaveAccessibleRule: false }); // Trigger two mouse events to simulate the first then second click. click(target, { clickCount: 1 }); click(target, { clickCount: 2 }); + AccessibilityUtils.resetEnv(); }; let tripleClick = target => { + // We intentionally turn off this a11y check, because the following series + // of clicks is purposefully targeting a non - interactive text content. + // This action does not require the element to have an interactive + // accessible to be done by assistive technology with caret browsing + // (when supported), this rule check shall be ignored by a11y_checks suite. + AccessibilityUtils.setEnv({ mustHaveAccessibleRule: false }); // Trigger all 3 mouse events to simulate the three mouse events we'd see. click(target, { clickCount: 1 }); click(target, { clickCount: 2 }); click(target, { clickCount: 3 }); + AccessibilityUtils.resetEnv(); }; // Check double-click to edit a boolean. diff --git a/toolkit/components/aboutmemory/content/aboutMemory.js b/toolkit/components/aboutmemory/content/aboutMemory.js index da2fd560d2..049818263f 100644 --- a/toolkit/components/aboutmemory/content/aboutMemory.js +++ b/toolkit/components/aboutmemory/content/aboutMemory.js @@ -2469,7 +2469,11 @@ function saveReportsToFile() { }; try { - fp.init(window, "Save Memory Reports", Ci.nsIFilePicker.modeSave); + fp.init( + window.browsingContext, + "Save Memory Reports", + Ci.nsIFilePicker.modeSave + ); } catch (ex) { // This will fail on Android, since there is no Save as file picker there. // Just save to the default downloads dir if it does. diff --git a/toolkit/components/antitracking/ContentBlockingAllowList.cpp b/toolkit/components/antitracking/ContentBlockingAllowList.cpp index 25806cd1e7..660906a49c 100644 --- a/toolkit/components/antitracking/ContentBlockingAllowList.cpp +++ b/toolkit/components/antitracking/ContentBlockingAllowList.cpp @@ -17,7 +17,9 @@ #include "nsICookieJarSettings.h" #include "nsIHttpChannel.h" #include "nsIHttpChannelInternal.h" +#include "nsIPermission.h" #include "nsNetUtil.h" +#include "nsString.h" using namespace mozilla; @@ -255,3 +257,70 @@ nsresult ContentBlockingAllowList::Check( returnInputArgument.release(); principal.forget(aPrincipal); } + +// ContentBlockingAllowListCache + +nsresult ContentBlockingAllowListCache::CheckForBaseDomain( + const nsACString& aBaseDomain, const OriginAttributes& aOriginAttributes, + bool& aIsAllowListed) { + MOZ_ASSERT(XRE_IsParentProcess()); + NS_ENSURE_TRUE(!aBaseDomain.IsEmpty(), NS_ERROR_INVALID_ARG); + aIsAllowListed = false; + + // Ensure we have the permission list. + nsresult rv = EnsureInit(); + NS_ENSURE_SUCCESS(rv, rv); + + if (aOriginAttributes.mPrivateBrowsingId > 0) { + aIsAllowListed = mEntriesPrivateBrowsing.Contains(aBaseDomain); + } else { + aIsAllowListed = mEntries.Contains(aBaseDomain); + } + + return NS_OK; +} + +nsresult ContentBlockingAllowListCache::EnsureInit() { + MOZ_ASSERT(XRE_IsParentProcess()); + + if (mIsInitialized) { + return NS_OK; + } + mIsInitialized = true; + + // 1. Get all permissions representing allow-list entries. + PermissionManager* permManager = PermissionManager::GetInstance(); + NS_ENSURE_TRUE(permManager, NS_ERROR_FAILURE); + + nsTArray types; + types.AppendElement("trackingprotection"); + types.AppendElement("trackingprotection-pb"); + + nsTArray> permissions; + nsresult rv = permManager->GetAllByTypes(types, permissions); + NS_ENSURE_SUCCESS(rv, rv); + + // 2. Populate mEntries and mEntriesPrivateBrowsing from permission list for + // faster lookup. + for (auto& permission : permissions) { + MOZ_ASSERT(permission); + + nsCOMPtr principal; + rv = permission->GetPrincipal(getter_AddRefs(principal)); + NS_ENSURE_SUCCESS(rv, rv); + MOZ_ASSERT(principal); + + nsAutoCString baseDomain; + rv = principal->GetBaseDomain(baseDomain); + NS_ENSURE_SUCCESS(rv, rv); + + // Sort base domains into sets for normal / private browsing. + if (principal->OriginAttributesRef().mPrivateBrowsingId > 0) { + mEntriesPrivateBrowsing.Insert(baseDomain); + } else { + mEntries.Insert(baseDomain); + } + } + + return NS_OK; +} diff --git a/toolkit/components/antitracking/ContentBlockingAllowList.h b/toolkit/components/antitracking/ContentBlockingAllowList.h index 2601173db7..1db29f3e35 100644 --- a/toolkit/components/antitracking/ContentBlockingAllowList.h +++ b/toolkit/components/antitracking/ContentBlockingAllowList.h @@ -9,6 +9,8 @@ #include "mozilla/dom/BrowsingContext.h" #include "nsIContentBlockingAllowList.h" +#include "nsIPermission.h" +#include "nsTHashSet.h" class nsICookieJarSettings; class nsIHttpChannel; @@ -19,7 +21,59 @@ class nsPIDOMWindowInner; namespace mozilla { class OriginAttributes; -struct ContentBlockingAllowListCache; + +/** + * @class ContentBlockingAllowListCache + * + * @brief This class represents a cache for the content blocking allow list. It + * is used for repeated lookups of the allow list for a specific base + * domain. Only use it if you need base domain lookups. In most cases + * this is not what you want. For regular allow-list checks by principal + * please use ContentBlockingAllowList. + */ +class ContentBlockingAllowListCache final { + public: + /** + * @brief Checks if a given base domain is allow-listed. This method considers + * the domain to be allow list if either the base domain or any of its + * subdomains are allow-listed. + * This is different from regular allow-list checks, + * @see{ContentBlockingAllowList::Check} where allow-listed state is only + * inherited to subdomains if the base domain is allow-listed. + * + * Example: + * If "example.com" is allow-listed, then "www.example.com" is also + * considered allow-listed. + * If foobar.example.org is allow-listed, then "example.org" is not + * considered allow-listed. + * + * @param aBaseDomain The base domain to check. + * @param aOriginAttributes The origin attributes associated with the base + * domain. + * @param aIsAllowListed [out] Set to true if the base domain is allow-listed, + * false otherwise. + * + * @return NS_OK if the check is successful, or an error code otherwise. + */ + nsresult CheckForBaseDomain(const nsACString& aBaseDomain, + const OriginAttributes& aOriginAttributes, + bool& aIsAllowListed); + + private: + bool mIsInitialized = false; + + // The cache is a hash set of base domains. If a base domain is in the set, it + // is allow-listed for that context (normal browsing, private browsing.) + nsTHashSet mEntries; + nsTHashSet mEntriesPrivateBrowsing; + + /** + * @brief Initializes the content blocking allow list cache if needed. + * + * @return NS_OK if initialization is successful, or an error code otherwise. + */ + nsresult EnsureInit(); +}; class ContentBlockingAllowList final : public nsIContentBlockingAllowList { public: diff --git a/toolkit/components/antitracking/ContentBlockingAllowList.sys.mjs b/toolkit/components/antitracking/ContentBlockingAllowList.sys.mjs index af1028083c..7efb0e7810 100644 --- a/toolkit/components/antitracking/ContentBlockingAllowList.sys.mjs +++ b/toolkit/components/antitracking/ContentBlockingAllowList.sys.mjs @@ -26,7 +26,7 @@ export const ContentBlockingAllowList = { "nsISupportsWeakReference", ]), - observe(subject, topic, data) { + observe(subject, topic) { if (topic == "last-pb-context-exited") { Services.perms.removeByType("trackingprotection-pb"); } diff --git a/toolkit/components/antitracking/PurgeTrackerService.sys.mjs b/toolkit/components/antitracking/PurgeTrackerService.sys.mjs index 08b5612287..458a35fef3 100644 --- a/toolkit/components/antitracking/PurgeTrackerService.sys.mjs +++ b/toolkit/components/antitracking/PurgeTrackerService.sys.mjs @@ -52,7 +52,7 @@ PurgeTrackerService.prototype = { // protection list, so we cache the result for faster future lookups. _trackingState: new Map(), - observe(aSubject, aTopic, aData) { + observe(aSubject, aTopic) { switch (aTopic) { case "idle-daily": // only allow one idle-daily listener to trigger until the list has been fully parsed. diff --git a/toolkit/components/antitracking/URLDecorationAnnotationsService.sys.mjs b/toolkit/components/antitracking/URLDecorationAnnotationsService.sys.mjs index ca285e972d..e445c8ec33 100644 --- a/toolkit/components/antitracking/URLDecorationAnnotationsService.sys.mjs +++ b/toolkit/components/antitracking/URLDecorationAnnotationsService.sys.mjs @@ -40,7 +40,7 @@ URLDecorationAnnotationsService.prototype = { branch.lockPref(PREF_NAME); }, - observe(aSubject, aTopic, aData) { + observe(aSubject, aTopic) { if (aTopic == "profile-after-change") { this.ensureUpdated(); } diff --git a/toolkit/components/antitracking/URLQueryStringStripper.cpp b/toolkit/components/antitracking/URLQueryStringStripper.cpp index 3b46738280..2e154b9103 100644 --- a/toolkit/components/antitracking/URLQueryStringStripper.cpp +++ b/toolkit/components/antitracking/URLQueryStringStripper.cpp @@ -98,7 +98,7 @@ URLQueryStringStripper::StripForCopyOrShare(nsIURI* aURI, URLParams params; - URLParams::Parse(query, [&](nsString&& name, nsString&& value) { + URLParams::Parse(query, true, [&](nsString&& name, nsString&& value) { nsAutoString lowerCaseName; ToLowerCase(name, lowerCaseName); // Look through the global rules. @@ -308,7 +308,7 @@ nsresult URLQueryStringStripper::StripQueryString(nsIURI* aURI, URLParams params; - URLParams::Parse(query, [&](nsString&& name, nsString&& value) { + URLParams::Parse(query, false, [&](nsString&& name, nsString&& value) { nsAutoString lowerCaseName; ToLowerCase(name, lowerCaseName); diff --git a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtection.cpp b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtection.cpp index e5d9ccfea9..2b0577d5c6 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtection.cpp +++ b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtection.cpp @@ -12,6 +12,7 @@ #include "ErrorList.h" #include "mozilla/AlreadyAddRefed.h" #include "mozilla/ClearOnShutdown.h" +#include "mozilla/ContentBlockingAllowList.h" #include "mozilla/Logging.h" #include "mozilla/Services.h" #include "mozilla/StaticPrefs_privacy.h" @@ -122,7 +123,7 @@ nsresult BounceTrackingProtection::RecordStatefulBounces( aBounceTrackingState->Describe().get())); // Assert: navigable’s bounce tracking record is not null. - BounceTrackingRecord* record = + const Maybe& record = aBounceTrackingState->GetBounceTrackingRecord(); NS_ENSURE_TRUE(record, NS_ERROR_FAILURE); @@ -368,6 +369,11 @@ BounceTrackingProtection::TestRunPurgeBounceTrackers( return NS_OK; } +NS_IMETHODIMP +BounceTrackingProtection::TestClearExpiredUserActivations() { + return ClearExpiredUserInteractions(); +} + NS_IMETHODIMP BounceTrackingProtection::TestAddBounceTrackerCandidate( JS::Handle aOriginAttributes, const nsACString& aHost, @@ -415,6 +421,22 @@ BounceTrackingProtection::TestAddUserActivation( RefPtr BounceTrackingProtection::PurgeBounceTrackers() { + // Prevent multiple purge operations from running at the same time. + if (mPurgeInProgress) { + MOZ_LOG(gBounceTrackingProtectionLog, LogLevel::Debug, + ("%s: Skip: Purge already in progress.", __FUNCTION__)); + return PurgeBounceTrackersMozPromise::CreateAndReject( + nsresult::NS_ERROR_NOT_AVAILABLE, __func__); + } + mPurgeInProgress = true; + + // Obtain a cache of ContentBlockingAllowList permissions so we only need to + // fetch permissions once even when we do multiple base domain lookups. + ContentBlockingAllowListCache contentBlockingAllowListCache; + + // Collect promises for all clearing operations to later await on. + nsTArray> clearPromises; + // Run the purging algorithm for all global state objects. for (const auto& entry : mStorage->StateGlobalMapRef()) { const OriginAttributes& originAttributes = entry.GetKey(); @@ -429,13 +451,17 @@ BounceTrackingProtection::PurgeBounceTrackers() { oaSuffix.get())); } - PurgeBounceTrackersForStateGlobal(stateGlobal, originAttributes); + nsresult rv = PurgeBounceTrackersForStateGlobal( + stateGlobal, contentBlockingAllowListCache, clearPromises); + if (NS_WARN_IF(NS_FAILED(rv))) { + return PurgeBounceTrackersMozPromise::CreateAndReject(rv, __func__); + } } // Wait for all data clearing operations to complete. mClearPromises contains // one promise per host / clear task. return ClearDataMozPromise::AllSettled(GetCurrentSerialEventTarget(), - mClearPromises) + clearPromises) ->Then( GetCurrentSerialEventTarget(), __func__, [&](ClearDataMozPromise::AllSettledPromiseType::ResolveOrRejectValue&& @@ -450,7 +476,7 @@ BounceTrackingProtection::PurgeBounceTrackers() { // If any clear call failed reject. for (auto& result : aResults.ResolveValue()) { if (result.IsReject()) { - mClearPromises.Clear(); + mPurgeInProgress = false; return PurgeBounceTrackersMozPromise::CreateAndReject( NS_ERROR_FAILURE, __func__); } @@ -458,7 +484,8 @@ BounceTrackingProtection::PurgeBounceTrackers() { } // No clearing errors, resolve. - mClearPromises.Clear(); + + mPurgeInProgress = false; return PurgeBounceTrackersMozPromise::CreateAndResolve( std::move(purgedSiteHosts), __func__); }); @@ -466,34 +493,17 @@ BounceTrackingProtection::PurgeBounceTrackers() { nsresult BounceTrackingProtection::PurgeBounceTrackersForStateGlobal( BounceTrackingStateGlobal* aStateGlobal, - const OriginAttributes& aOriginAttributes) { + ContentBlockingAllowListCache& aContentBlockingAllowList, + nsTArray>& aClearPromises) { MOZ_ASSERT(aStateGlobal); MOZ_LOG(gBounceTrackingProtectionLog, LogLevel::Debug, - ("%s: #mUserActivation: %d, #mBounceTrackers: %d", __FUNCTION__, - aStateGlobal->UserActivationMapRef().Count(), - aStateGlobal->BounceTrackersMapRef().Count())); - - // Purge already in progress. - if (!mClearPromises.IsEmpty()) { - MOZ_LOG(gBounceTrackingProtectionLog, LogLevel::Debug, - ("%s: Skip: Purge already in progress.", __FUNCTION__)); - return NS_ERROR_NOT_AVAILABLE; - } + ("%s: %s", __FUNCTION__, aStateGlobal->Describe().get())); const PRTime now = PR_Now(); - // Convert the user activation lifetime into microseconds for calculation with - // PRTime values. The pref is a 32-bit value. Cast into 64-bit before - // multiplying so we get the correct result. - int64_t activationLifetimeUsec = - static_cast( - StaticPrefs:: - privacy_bounceTrackingProtection_bounceTrackingActivationLifetimeSec()) * - PR_USEC_PER_SEC; // 1. Remove hosts from the user activation map whose user activation flag has // expired. - nsresult rv = - aStateGlobal->ClearUserActivationBefore(now - activationLifetimeUsec); + nsresult rv = ClearExpiredUserInteractions(aStateGlobal); NS_ENSURE_SUCCESS(rv, rv); // 2. Go over bounce tracker candidate map and purge state. @@ -502,7 +512,6 @@ nsresult BounceTrackingProtection::PurgeBounceTrackersForStateGlobal( do_GetService("@mozilla.org/clear-data-service;1", &rv); NS_ENSURE_SUCCESS(rv, rv); - mClearPromises.Clear(); nsTArray purgedSiteHosts; // Collect hosts to remove from the bounce trackers map. We can not remove @@ -545,6 +554,27 @@ nsresult BounceTrackingProtection::PurgeBounceTrackersForStateGlobal( continue; } + // Gecko specific: If the host is on the content blocking allow-list, + // continue. + bool isAllowListed = false; + rv = aContentBlockingAllowList.CheckForBaseDomain( + host, aStateGlobal->OriginAttributesRef(), isAllowListed); + if (NS_WARN_IF(NS_FAILED(rv))) { + continue; + } + if (isAllowListed) { + if (MOZ_LOG_TEST(gBounceTrackingProtectionLog, LogLevel::Debug)) { + nsAutoCString originAttributeSuffix; + aStateGlobal->OriginAttributesRef().CreateSuffix(originAttributeSuffix); + MOZ_LOG(gBounceTrackingProtectionLog, LogLevel::Debug, + ("%s: Skip host on the content blocking allow-list: host: %s, " + "originAttributes: %s", + __FUNCTION__, PromiseFlatCString(host).get(), + originAttributeSuffix.get())); + } + continue; + } + // No exception above applies, clear state for the given host. RefPtr clearPromise = @@ -562,7 +592,7 @@ nsresult BounceTrackingProtection::PurgeBounceTrackersForStateGlobal( clearPromise->Reject(0, __func__); } - mClearPromises.AppendElement(clearPromise); + aClearPromises.AppendElement(clearPromise); // Remove it from the bounce trackers map, it's about to be purged. If the // clear call fails still remove it. We want to avoid an ever growing list @@ -575,6 +605,43 @@ nsresult BounceTrackingProtection::PurgeBounceTrackersForStateGlobal( return aStateGlobal->RemoveBounceTrackers(bounceTrackerCandidatesToRemove); } +nsresult BounceTrackingProtection::ClearExpiredUserInteractions( + BounceTrackingStateGlobal* aStateGlobal) { + if (!aStateGlobal && mStorage->StateGlobalMapRef().IsEmpty()) { + // Nothing to clear. + return NS_OK; + } + + const PRTime now = PR_Now(); + + // Convert the user activation lifetime into microseconds for calculation with + // PRTime values. The pref is a 32-bit value. Cast into 64-bit before + // multiplying so we get the correct result. + int64_t activationLifetimeUsec = + static_cast( + StaticPrefs:: + privacy_bounceTrackingProtection_bounceTrackingActivationLifetimeSec()) * + PR_USEC_PER_SEC; + + // Clear user activation for the given state global. + if (aStateGlobal) { + return aStateGlobal->ClearUserActivationBefore(now - + activationLifetimeUsec); + } + + // aStateGlobal not passed, clear user activation for all state globals. + for (const auto& entry : mStorage->StateGlobalMapRef()) { + const RefPtr& stateGlobal = entry.GetData(); + MOZ_ASSERT(stateGlobal); + + nsresult rv = + stateGlobal->ClearUserActivationBefore(now - activationLifetimeUsec); + NS_ENSURE_SUCCESS(rv, rv); + } + + return NS_OK; +} + // ClearDataCallback NS_IMPL_ISUPPORTS(BounceTrackingProtection::ClearDataCallback, diff --git a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtection.h b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtection.h index 98c61504c0..e99cf895be 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtection.h +++ b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingProtection.h @@ -17,6 +17,7 @@ namespace mozilla { class BounceTrackingState; class BounceTrackingStateGlobal; class BounceTrackingProtectionStorage; +class ContentBlockingAllowListCache; class OriginAttributes; extern LazyLogModule gBounceTrackingProtectionLog; @@ -33,10 +34,17 @@ class BounceTrackingProtection final : public nsIBounceTrackingProtection { // navigation start for bounce tracking, or if the client bounce detection // timer expires after process response received for bounce tracking without // observing a client redirect. - nsresult RecordStatefulBounces(BounceTrackingState* aBounceTrackingState); + [[nodiscard]] nsresult RecordStatefulBounces( + BounceTrackingState* aBounceTrackingState); // Stores a user activation flag with a timestamp for the given principal. - nsresult RecordUserActivation(nsIPrincipal* aPrincipal); + [[nodiscard]] nsresult RecordUserActivation(nsIPrincipal* aPrincipal); + + // Clears expired user interaction flags for the given state global. If + // aStateGlobal == nullptr, clears expired user interaction flags for all + // state globals. + [[nodiscard]] nsresult ClearExpiredUserInteractions( + BounceTrackingStateGlobal* aStateGlobal = nullptr); private: BounceTrackingProtection(); @@ -53,13 +61,19 @@ class BounceTrackingProtection final : public nsIBounceTrackingProtection { MozPromise, nsresult, true>; RefPtr PurgeBounceTrackers(); - nsresult PurgeBounceTrackersForStateGlobal( - BounceTrackingStateGlobal* aStateGlobal, - const OriginAttributes& aOriginAttributes); - // Pending clear operations are stored as ClearDataMozPromise, one per host. using ClearDataMozPromise = MozPromise; - nsTArray> mClearPromises; + + // Clear state for classified bounce trackers for a specific state global. + // aClearPromises is populated with promises for each host that is cleared. + [[nodiscard]] nsresult PurgeBounceTrackersForStateGlobal( + BounceTrackingStateGlobal* aStateGlobal, + ContentBlockingAllowListCache& aContentBlockingAllowList, + nsTArray>& aClearPromises); + + // Whether a purge operation is currently in progress. This avoids running + // multiple purge operations at the same time. + bool mPurgeInProgress = false; // Wraps nsIClearDataCallback in MozPromise. class ClearDataCallback final : public nsIClearDataCallback { diff --git a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingRecord.cpp b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingRecord.cpp index 14ee178ae2..d4b33f9edb 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingRecord.cpp +++ b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingRecord.cpp @@ -12,13 +12,11 @@ namespace mozilla { extern LazyLogModule gBounceTrackingProtectionLog; -NS_IMPL_CYCLE_COLLECTION(BounceTrackingRecord); - void BounceTrackingRecord::SetInitialHost(const nsACString& aHost) { mInitialHost = aHost; } -const nsACString& BounceTrackingRecord::GetInitialHost() { +const nsACString& BounceTrackingRecord::GetInitialHost() const { return mInitialHost; } @@ -26,7 +24,9 @@ void BounceTrackingRecord::SetFinalHost(const nsACString& aHost) { mFinalHost = aHost; } -const nsACString& BounceTrackingRecord::GetFinalHost() { return mFinalHost; } +const nsACString& BounceTrackingRecord::GetFinalHost() const { + return mFinalHost; +} void BounceTrackingRecord::AddBounceHost(const nsACString& aHost) { mBounceHosts.Insert(aHost); @@ -57,11 +57,12 @@ void BounceTrackingRecord::AddStorageAccessHost(const nsACString& aHost) { mStorageAccessHosts.Insert(aHost); } -const nsTHashSet& BounceTrackingRecord::GetBounceHosts() { +const nsTHashSet& BounceTrackingRecord::GetBounceHosts() const { return mBounceHosts; } -const nsTHashSet& BounceTrackingRecord::GetStorageAccessHosts() { +const nsTHashSet& BounceTrackingRecord::GetStorageAccessHosts() + const { return mStorageAccessHosts; } diff --git a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingRecord.h b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingRecord.h index d3e980d00b..73985a00a4 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingRecord.h +++ b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingRecord.h @@ -7,9 +7,7 @@ #ifndef mozilla_BounceTrackingRecord_h #define mozilla_BounceTrackingRecord_h -#include "nsISupports.h" #include "nsStringFwd.h" -#include "nsCycleCollectionParticipant.h" #include "nsTHashSet.h" namespace mozilla { @@ -22,31 +20,26 @@ class CanonicalBrowsingContext; // navigation. class BounceTrackingRecord final { public: - NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(BounceTrackingRecord); - NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(BounceTrackingRecord); - void SetInitialHost(const nsACString& aHost); - const nsACString& GetInitialHost(); + const nsACString& GetInitialHost() const; void SetFinalHost(const nsACString& aHost); - const nsACString& GetFinalHost(); + const nsACString& GetFinalHost() const; void AddBounceHost(const nsACString& aHost); void AddStorageAccessHost(const nsACString& aHost); - const nsTHashSet& GetBounceHosts(); + const nsTHashSet& GetBounceHosts() const; - const nsTHashSet& GetStorageAccessHosts(); + const nsTHashSet& GetStorageAccessHosts() const; // Create a string that describes this record. Used for logging. nsCString Describe(); private: - ~BounceTrackingRecord() = default; - // A site's host. The initiator site of the current extended navigation. nsAutoCString mInitialHost; diff --git a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingState.cpp b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingState.cpp index c5abb8b8d7..b4af3daa07 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingState.cpp +++ b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingState.cpp @@ -143,10 +143,11 @@ nsresult BounceTrackingState::Init( } void BounceTrackingState::ResetBounceTrackingRecord() { - mBounceTrackingRecord = nullptr; + mBounceTrackingRecord = Nothing(); } -BounceTrackingRecord* BounceTrackingState::GetBounceTrackingRecord() { +const Maybe& +BounceTrackingState::GetBounceTrackingRecord() { return mBounceTrackingRecord; } @@ -452,7 +453,7 @@ nsresult BounceTrackingState::OnStartNavigation( // tracking record to a new bounce tracking record with initial host set to // initialHost. if (!mBounceTrackingRecord) { - mBounceTrackingRecord = new BounceTrackingRecord(); + mBounceTrackingRecord = Some(BounceTrackingRecord()); mBounceTrackingRecord->SetInitialHost(siteHost); MOZ_LOG(gBounceTrackingProtectionLog, LogLevel::Debug, @@ -477,7 +478,7 @@ nsresult BounceTrackingState::OnStartNavigation( NS_ENSURE_SUCCESS(rv, rv); MOZ_ASSERT(!mBounceTrackingRecord); - mBounceTrackingRecord = new BounceTrackingRecord(); + mBounceTrackingRecord = Some(BounceTrackingRecord()); mBounceTrackingRecord->SetInitialHost(siteHost); return NS_OK; @@ -539,8 +540,12 @@ nsresult BounceTrackingState::OnResponseReceived( ("%s: Calling RecordStatefulBounces after timeout.", __FUNCTION__)); BounceTrackingState* bounceTrackingState = thisWeak; - bounceTrackingState->mBounceTrackingProtection->RecordStatefulBounces( - bounceTrackingState); + DebugOnly rv = + bounceTrackingState->mBounceTrackingProtection + ->RecordStatefulBounces(bounceTrackingState); + NS_WARNING_ASSERTION( + NS_SUCCEEDED(rv), + "Running RecordStatefulBounces after a timeout failed."); bounceTrackingState->mClientBounceDetectionTimeout = nullptr; }, diff --git a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingState.h b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingState.h index 70deee5abe..17d324bda9 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingState.h +++ b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingState.h @@ -7,6 +7,7 @@ #ifndef mozilla_BounceTrackingState_h #define mozilla_BounceTrackingState_h +#include "BounceTrackingRecord.h" #include "mozilla/WeakPtr.h" #include "mozilla/OriginAttributes.h" #include "nsIPrincipal.h" @@ -22,7 +23,6 @@ class nsIPrincipal; namespace mozilla { class BounceTrackingProtection; -class BounceTrackingRecord; namespace dom { class CanonicalBrowsingContext; @@ -55,7 +55,7 @@ class BounceTrackingState : public nsIWebProgressListener, static void ResetAllForOriginAttributesPattern( const OriginAttributesPattern& aPattern); - BounceTrackingRecord* GetBounceTrackingRecord(); + const Maybe& GetBounceTrackingRecord(); void ResetBounceTrackingRecord(); @@ -113,7 +113,7 @@ class BounceTrackingState : public nsIWebProgressListener, // Record to keep track of extended navigation data. Reset on extended // navigation end. - RefPtr mBounceTrackingRecord; + Maybe mBounceTrackingRecord; // Timer to wait to wait for a client redirect after a navigation ends. RefPtr mClientBounceDetectionTimeout; diff --git a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingStateGlobal.cpp b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingStateGlobal.cpp index 3481753431..b94c887c90 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingStateGlobal.cpp +++ b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingStateGlobal.cpp @@ -106,6 +106,11 @@ nsresult BounceTrackingStateGlobal::ClearByTimeRange( NS_ENSURE_ARG_MIN(aFrom, 0); NS_ENSURE_TRUE(!aTo || aTo.value() > aFrom, NS_ERROR_INVALID_ARG); + MOZ_LOG(gBounceTrackingProtectionLog, LogLevel::Debug, + ("%s: Clearing user activations by time range from %" PRIu64 + " to %" PRIu64 " %s", + __FUNCTION__, aFrom, aTo.valueOr(0), Describe().get())); + // Clear in memory user activation data. if (aEntryType.isNothing() || aEntryType.value() == @@ -113,10 +118,10 @@ nsresult BounceTrackingStateGlobal::ClearByTimeRange( for (auto iter = mUserActivation.Iter(); !iter.Done(); iter.Next()) { if (iter.Data() >= aFrom && (aTo.isNothing() || iter.Data() <= aTo.value())) { - iter.Remove(); MOZ_LOG(gBounceTrackingProtectionLog, LogLevel::Debug, ("%s: Remove user activation for %s", __FUNCTION__, PromiseFlatCString(iter.Key()).get())); + iter.Remove(); } } } @@ -128,10 +133,10 @@ nsresult BounceTrackingStateGlobal::ClearByTimeRange( for (auto iter = mBounceTrackers.Iter(); !iter.Done(); iter.Next()) { if (iter.Data() >= aFrom && (aTo.isNothing() || iter.Data() <= aTo.value())) { - iter.Remove(); MOZ_LOG(gBounceTrackingProtectionLog, LogLevel::Debug, ("%s: Remove bouncer tracker for %s", __FUNCTION__, PromiseFlatCString(iter.Key()).get())); + iter.Remove(); } } } @@ -187,4 +192,27 @@ nsresult BounceTrackingStateGlobal::RemoveBounceTrackers( return NS_OK; } +// static +nsCString BounceTrackingStateGlobal::DescribeMap( + const nsTHashMap& aMap) { + nsAutoCString mapStr; + + for (auto iter = aMap.ConstIter(); !iter.Done(); iter.Next()) { + mapStr.Append(nsPrintfCString("{ %s: %" PRIu64 " }, ", + PromiseFlatCString(iter.Key()).get(), + iter.Data())); + } + + return std::move(mapStr); +} + +nsCString BounceTrackingStateGlobal::Describe() { + nsAutoCString originAttributeSuffix; + mOriginAttributes.CreateSuffix(originAttributeSuffix); + return nsPrintfCString( + "{ mOriginAttributes: %s, mUserActivation: %s, mBounceTrackers: %s }", + originAttributeSuffix.get(), DescribeMap(mUserActivation).get(), + DescribeMap(mBounceTrackers).get()); +} + } // namespace mozilla diff --git a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingStateGlobal.h b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingStateGlobal.h index 6680ceae6f..c8ed72c11f 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingStateGlobal.h +++ b/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingStateGlobal.h @@ -37,6 +37,10 @@ class BounceTrackingStateGlobal final { bool ShouldPersistToDisk() const { return !IsPrivateBrowsing(); } + const OriginAttributes& OriginAttributesRef() const { + return mOriginAttributes; + }; + bool HasUserActivation(const nsACString& aSiteHost) const; // Store a user interaction flag for the given host. This will remove the @@ -79,6 +83,9 @@ class BounceTrackingStateGlobal final { return mBounceTrackers; } + // Create a string that describes this object. Used for logging. + nsCString Describe(); + private: ~BounceTrackingStateGlobal() = default; @@ -103,6 +110,10 @@ class BounceTrackingStateGlobal final { // on the given site host performed an action that could indicate stateful // bounce tracking took place. nsTHashMap mBounceTrackers{}; + + // Helper to create a string representation of a siteHost -> timestamp map. + static nsCString DescribeMap( + const nsTHashMap& aMap); }; } // namespace mozilla diff --git a/toolkit/components/antitracking/bouncetrackingprotection/nsIBounceTrackingProtection.idl b/toolkit/components/antitracking/bouncetrackingprotection/nsIBounceTrackingProtection.idl index 9ade9cb0ea..1163492333 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/nsIBounceTrackingProtection.idl +++ b/toolkit/components/antitracking/bouncetrackingprotection/nsIBounceTrackingProtection.idl @@ -28,6 +28,10 @@ interface nsIBounceTrackingProtection : nsISupports { [implicit_jscontext] Promise testRunPurgeBounceTrackers(); + // Clear expired user activation flags. Expiry is set via pref + // "privacy.bounceTrackingProtection.bounceTrackingActivationLifetimeSec". + void testClearExpiredUserActivations(); + // Getters and setters for user activation and bounce tracker state. // These are used for testing purposes only. // State is keyed by OriginAttributes. diff --git a/toolkit/components/antitracking/bouncetrackingprotection/test/browser/browser_bouncetracking_purge.js b/toolkit/components/antitracking/bouncetrackingprotection/test/browser/browser_bouncetracking_purge.js index a8e98b80f0..eedd374197 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/test/browser/browser_bouncetracking_purge.js +++ b/toolkit/components/antitracking/bouncetrackingprotection/test/browser/browser_bouncetracking_purge.js @@ -119,3 +119,69 @@ add_task(async function test_purging_skip_open_tab_extra_window() { bounceTrackingProtection.clearAll(); }); + +add_task(async function test_purging_skip_content_blocking_allow_list() { + initBounceTrackerState(); + + await BrowserTestUtils.withNewTab("https://example.com", async browser => { + window.ContentBlockingAllowList.add(browser); + }); + + Assert.deepEqual( + await bounceTrackingProtection.testRunPurgeBounceTrackers(), + ["example.net"], + "Should only purge example.net. example.org is within the grace period, example.com is allow-listed." + ); + + info( + "Remove the allow-list entry for example.com and test that it gets purged now." + ); + + await BrowserTestUtils.withNewTab("https://example.com", async browser => { + window.ContentBlockingAllowList.remove(browser); + }); + Assert.deepEqual( + await bounceTrackingProtection.testRunPurgeBounceTrackers(), + ["example.com"], + "example.com should have been purged now that it is no longer allow-listed." + ); + + bounceTrackingProtection.clearAll(); +}); + +add_task( + async function test_purging_skip_content_blocking_allow_list_subdomain() { + initBounceTrackerState(); + + await BrowserTestUtils.withNewTab( + "https://test1.example.com", + async browser => { + window.ContentBlockingAllowList.add(browser); + } + ); + + Assert.deepEqual( + await bounceTrackingProtection.testRunPurgeBounceTrackers(), + ["example.net"], + "Should only purge example.net. example.org is within the grace period, example.com is allow-listed via test1.example.com." + ); + + info( + "Remove the allow-list entry for test1.example.com and test that it gets purged now." + ); + + await BrowserTestUtils.withNewTab( + "https://test1.example.com", + async browser => { + window.ContentBlockingAllowList.remove(browser); + } + ); + Assert.deepEqual( + await bounceTrackingProtection.testRunPurgeBounceTrackers(), + ["example.com"], + "example.com should have been purged now that test1.example.com it is no longer allow-listed." + ); + + bounceTrackingProtection.clearAll(); + } +); diff --git a/toolkit/components/antitracking/bouncetrackingprotection/test/xpcshell/test_bouncetracking_clearExpiredUserActivation.js b/toolkit/components/antitracking/bouncetrackingprotection/test/xpcshell/test_bouncetracking_clearExpiredUserActivation.js new file mode 100644 index 0000000000..28a1350b3e --- /dev/null +++ b/toolkit/components/antitracking/bouncetrackingprotection/test/xpcshell/test_bouncetracking_clearExpiredUserActivation.js @@ -0,0 +1,85 @@ +/* Any copyright is dedicated to the Public Domain. +http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/** + * Test that expired user activations are cleared by the the helper method + * testClearExpiredUserActivations. + */ +add_task(async function test() { + // Need a profile to data clearing calls. + do_get_profile(); + + let btp = Cc["@mozilla.org/bounce-tracking-protection;1"].getService( + Ci.nsIBounceTrackingProtection + ); + + // Reset global bounce tracking state. + btp.clearAll(); + + // Assert initial test state. + Assert.deepEqual( + btp.testGetBounceTrackerCandidateHosts({}), + [], + "No tracker candidates initially." + ); + Assert.deepEqual( + btp.testGetUserActivationHosts({}), + [], + "No user activation hosts initially." + ); + + // Get the bounce tracking activation lifetime. The pref is in seconds, we + // need to convert it to microseconds, as the user activation timestamps are + // in microseconds (PRTime). + let bounceTrackingActivationLifetimeUSec = + 1000 * + 1000 * + Services.prefs.getIntPref( + "privacy.bounceTrackingProtection.bounceTrackingActivationLifetimeSec" + ); + + // Add some test data for user activation. + btp.testAddUserActivation({}, "not-expired1.com", Date.now() * 1000); + btp.testAddUserActivation( + {}, + "not-expired2.com", + Date.now() * 1000 - bounceTrackingActivationLifetimeUSec / 2 + ); + btp.testAddUserActivation( + { privateBrowsingId: 1 }, + "pbm-not-expired.com", + Date.now() * 1000 + ); + btp.testAddUserActivation( + {}, + "expired1.com", + Date.now() * 1000 - bounceTrackingActivationLifetimeUSec * 2 + ); + btp.testAddUserActivation( + {}, + "expired2.com", + Date.now() * 1000 - (bounceTrackingActivationLifetimeUSec + 1000 * 1000) + ); + btp.testAddUserActivation({ privateBrowsingId: 1 }, "pbm-expired.com", 1); + + // Clear expired user activations. + btp.testClearExpiredUserActivations(); + + // Assert that expired user activations have been cleared. + Assert.deepEqual( + btp.testGetUserActivationHosts({}).sort(), + ["not-expired1.com", "not-expired2.com"], + "Expired user activation flags have been cleared for normal browsing." + ); + + Assert.deepEqual( + btp.testGetUserActivationHosts({ privateBrowsingId: 1 }).sort(), + ["pbm-not-expired.com"], + "Expired user activation flags have been cleared for private browsing." + ); + + // Reset global bounce tracking state. + btp.clearAll(); +}); diff --git a/toolkit/components/antitracking/bouncetrackingprotection/test/xpcshell/xpcshell.toml b/toolkit/components/antitracking/bouncetrackingprotection/test/xpcshell/xpcshell.toml index 16e270b85c..c3aeee502f 100644 --- a/toolkit/components/antitracking/bouncetrackingprotection/test/xpcshell/xpcshell.toml +++ b/toolkit/components/antitracking/bouncetrackingprotection/test/xpcshell/xpcshell.toml @@ -5,4 +5,6 @@ prefs = [ "privacy.bounceTrackingProtection.bounceTrackingPurgeTimerPeriodSec=0", ] +["test_bouncetracking_clearExpiredUserActivation.js"] + ["test_bouncetracking_purge.js"] diff --git a/toolkit/components/antitracking/test/browser/3rdPartySVG.html b/toolkit/components/antitracking/test/browser/3rdPartySVG.html index df791f355f..9ce6fc8ba1 100644 --- a/toolkit/components/antitracking/test/browser/3rdPartySVG.html +++ b/toolkit/components/antitracking/test/browser/3rdPartySVG.html @@ -11,7 +11,7 @@

3rd party content with an SVG image background

diff --git a/toolkit/components/passwordmgr/test/mochitest/test_dismissed_doorhanger_in_shadow_DOM.html b/toolkit/components/passwordmgr/test/mochitest/test_dismissed_doorhanger_in_shadow_DOM.html index 87638b1132..5d014124a1 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_dismissed_doorhanger_in_shadow_DOM.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_dismissed_doorhanger_in_shadow_DOM.html @@ -67,13 +67,7 @@ async function editPasswordFieldInShadowDOM() { async function testForm(testcase) { const iframeLoaded = new Promise(resolve => { - IFRAME.addEventListener( - "load", - function(e) { - resolve(true); - }, - { once: true } - ); + IFRAME.addEventListener("load", _e => resolve(true), { once: true }); }); // This could complete before the page finishes loading. diff --git a/toolkit/components/passwordmgr/test/mochitest/test_formLike_rootElement_with_Shadow_DOM.html b/toolkit/components/passwordmgr/test/mochitest/test_formLike_rootElement_with_Shadow_DOM.html index 06458893ea..722a86efc9 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_formLike_rootElement_with_Shadow_DOM.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_formLike_rootElement_with_Shadow_DOM.html @@ -94,13 +94,7 @@ const TESTCASES = [ async function testForm(testcase) { const iframeLoaded = new Promise(resolve => { - IFRAME.addEventListener( - "load", - function(e) { - resolve(true); - }, - { once: true } - ); + IFRAME.addEventListener("load", _e => resolve(true), { once: true }); }); // This could complete before the page finishes loading. diff --git a/toolkit/components/passwordmgr/test/mochitest/test_formless_autofill.html b/toolkit/components/passwordmgr/test/mochitest/test_formless_autofill.html index 4d1b7582a9..05be33e4dd 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_formless_autofill.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_formless_autofill.html @@ -12,7 +12,7 @@ gTestDependsOnDeprecatedLogin = true; let doneSetupPromise = new Promise(resolve => { document.addEventListener("DOMContentLoaded", () => { - document.getElementById("loginFrame").addEventListener("load", async evt => { + document.getElementById("loginFrame").addEventListener("load", async _e => { // Tell the parent to setup test logins. await runChecksAfterCommonInit(); resolve(); diff --git a/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_form_removal.html b/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_form_removal.html index 5512c57db2..b2ff2d8845 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_form_removal.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_form_removal.html @@ -10,10 +10,8 @@ + + `); +}); + +add_task(async function test_change_event_with_mutation() { + await open_change_and_expect_one_change_event(`data:text/html, + + + + `); +}); diff --git a/toolkit/content/tests/browser/datetime/head.js b/toolkit/content/tests/browser/datetime/head.js index bbef72873c..46e2c78af5 100644 --- a/toolkit/content/tests/browser/datetime/head.js +++ b/toolkit/content/tests/browser/datetime/head.js @@ -113,15 +113,19 @@ class DateTimeTestHelper { EventUtils.synthesizeMouseAtCenter(element, {}, this.frame.contentWindow); } - /** - * Close the panel and the tab - */ - async tearDown() { + async closePicker() { if (this.panel.state != "closed") { let pickerClosePromise = this.promisePickerClosed(); this.panel.hidePopup(); await pickerClosePromise; } + } + + /** + * Close the panel and the tab + */ + async tearDown() { + await this.closePicker(); BrowserTestUtils.removeTab(this.tab); this.tab = null; } diff --git a/toolkit/content/tests/chrome/chrome.toml b/toolkit/content/tests/chrome/chrome.toml index 70fa12c4b6..3391a2923d 100644 --- a/toolkit/content/tests/chrome/chrome.toml +++ b/toolkit/content/tests/chrome/chrome.toml @@ -224,6 +224,8 @@ support-files = [ ["test_menulist_in_popup.xhtml"] +["test_menulist_initial_selection.xhtml"] + ["test_menulist_keynav.xhtml"] ["test_menulist_null_value.xhtml"] diff --git a/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml b/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml index b49f8a1d5e..005c6ebffe 100644 --- a/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml +++ b/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml @@ -57,9 +57,9 @@ function checkKeyCaretTest(key, expectedStart, expectedEnd, result, testid) keypressFired = true; } } - SpecialPowers.addSystemEventListener(window, "keypress", listener, false); + SpecialPowers.wrap(window).addEventListener("keypress", listener, { mozSystemGroup: true }); synthesizeKey(key, {}); - SpecialPowers.removeSystemEventListener(window, "keypress", listener, false); + SpecialPowers.wrap(window).removeEventListener("keypress", listener, { mozSystemGroup: true }); is(keypressFired, result, `${testid} keypress event should${result ? "" : " not"} be fired`); is(autocomplete.selectionStart, expectedStart, testid + " selectionStart"); is(autocomplete.selectionEnd, expectedEnd, testid + " selectionEnd"); diff --git a/toolkit/content/tests/chrome/test_menulist_initial_selection.xhtml b/toolkit/content/tests/chrome/test_menulist_initial_selection.xhtml new file mode 100644 index 0000000000..19e9beae67 --- /dev/null +++ b/toolkit/content/tests/chrome/test_menulist_initial_selection.xhtml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/toolkit/content/tests/chrome/window_tooltip.xhtml b/toolkit/content/tests/chrome/window_tooltip.xhtml index 6a573f0bd9..b78075de45 100644 --- a/toolkit/content/tests/chrome/window_tooltip.xhtml +++ b/toolkit/content/tests/chrome/window_tooltip.xhtml @@ -15,12 +15,12 @@ + `; + } +} +customElements.define("moz-button", MozButton); diff --git a/toolkit/content/widgets/moz-button/moz-button.stories.mjs b/toolkit/content/widgets/moz-button/moz-button.stories.mjs new file mode 100644 index 0000000000..52a459e807 --- /dev/null +++ b/toolkit/content/widgets/moz-button/moz-button.stories.mjs @@ -0,0 +1,100 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +import { html } from "../vendor/lit.all.mjs"; +// eslint-disable-next-line import/no-unassigned-import +import "./moz-button.mjs"; + +export default { + title: "UI Widgets/Moz Button", + component: "moz-button", + argTypes: { + l10nId: { + options: [ + "moz-button-labelled", + "moz-button-titled", + "moz-button-aria-labelled", + ], + control: { type: "select" }, + }, + size: { + options: ["default", "small"], + control: { type: "radio" }, + }, + }, + parameters: { + actions: { + handles: ["click"], + }, + status: "in-development", + fluent: ` +moz-button-labelled = Button +moz-button-primary = Primary +moz-button-destructive = Destructive +moz-button-titled = + .title = View logins +moz-button-aria-labelled = + .aria-label = View logins +`, + }, +}; + +const Template = ({ type, size, l10nId, iconUrl, disabled }) => html` + + +`; + +export const Default = Template.bind({}); +Default.args = { + type: "default", + size: "default", + l10nId: "moz-button-labelled", + iconUrl: "chrome://global/skin/icons/more.svg", + disabled: false, +}; +export const DefaultSmall = Template.bind({}); +DefaultSmall.args = { + type: "default", + size: "small", + l10nId: "moz-button-labelled", + iconUrl: "chrome://global/skin/icons/more.svg", + disabled: false, +}; +export const Primary = Template.bind({}); +Primary.args = { + ...Default.args, + type: "primary", + l10nId: "moz-button-primary", +}; +export const Destructive = Template.bind({}); +Destructive.args = { + ...Default.args, + type: "destructive", + l10nId: "moz-button-destructive", +}; +export const Icon = Template.bind({}); +Icon.args = { + ...Default.args, + type: "icon", + l10nId: "moz-button-titled", +}; +export const IconSmall = Template.bind({}); +IconSmall.args = { + ...Icon.args, + size: "small", +}; +export const IconGhost = Template.bind({}); +IconGhost.args = { + ...Icon.args, + type: "icon ghost", +}; diff --git a/toolkit/content/widgets/moz-input-box.js b/toolkit/content/widgets/moz-input-box.js index 4704db6dc5..6e7b7b3f29 100644 --- a/toolkit/content/widgets/moz-input-box.js +++ b/toolkit/content/widgets/moz-input-box.js @@ -92,7 +92,7 @@ }); if (this.spellcheck) { - this.menupopup.addEventListener("popuphiding", event => { + this.menupopup.addEventListener("popuphiding", () => { if (this.spellCheckerUI) { this.spellCheckerUI.clearSuggestionsFromMenu(); this.spellCheckerUI.clearDictionaryListFromMenu(); diff --git a/toolkit/content/widgets/moz-label/README.stories.md b/toolkit/content/widgets/moz-label/README.stories.md index a3492ebefa..f5e4e2dd14 100644 --- a/toolkit/content/widgets/moz-label/README.stories.md +++ b/toolkit/content/widgets/moz-label/README.stories.md @@ -3,10 +3,10 @@ `moz-label` is an extension of the built-in `HTMLLabelElement` that provides accesskey styling and formatting as well as some click handling logic. ```html story -