From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- browser/actors/ContentSearchParent.sys.mjs | 26 +- browser/actors/ContextMenuChild.sys.mjs | 17 - browser/actors/FormValidationChild.sys.mjs | 6 +- browser/actors/PromptParent.sys.mjs | 8 +- browser/actors/ScreenshotsComponentChild.sys.mjs | 48 +- browser/actors/SearchSERPTelemetryChild.sys.mjs | 484 +- browser/actors/WebRTCChild.sys.mjs | 2 +- browser/app/macbuild/Contents/Info.plist.in | 4 +- browser/app/macbuild/Contents/MacOS-files.in | 1 + browser/app/moz.build | 3 + browser/app/nmhproxy/Cargo.toml | 17 + browser/app/nmhproxy/moz.build | 15 + browser/app/nmhproxy/src/commands.rs | 350 + browser/app/nmhproxy/src/main.rs | 55 + browser/app/profile/firefox.js | 87 +- browser/app/winlauncher/LauncherProcessWin.cpp | 8 +- .../app/winlauncher/freestanding/DllBlocklist.cpp | 9 +- browser/base/content/appmenu-viewcache.inc.xhtml | 40 + browser/base/content/browser-context.inc | 6 +- browser/base/content/browser-ctrlTab.js | 13 +- browser/base/content/browser-places.js | 35 +- browser/base/content/browser-profiles.js | 99 + browser/base/content/browser-sets.inc | 6 +- browser/base/content/browser-sidebar.js | 2 +- browser/base/content/browser-siteProtections.js | 278 +- browser/base/content/browser.css | 77 +- browser/base/content/browser.js | 155 +- browser/base/content/browser.js.globals | 305 + browser/base/content/browser.xhtml | 2 + browser/base/content/contentTheme.js | 2 +- browser/base/content/main-popupset.inc.xhtml | 27 +- browser/base/content/moz.build | 3 + browser/base/content/navigator-toolbox.inc.xhtml | 6 +- browser/base/content/nsContextMenu.js | 123 +- browser/base/content/pageinfo/pageInfo.js | 2 +- browser/base/content/popup-notifications.inc | 8 +- browser/base/content/sanitizeDialog.js | 112 +- browser/base/content/sanitize_v2.xhtml | 69 + browser/base/content/tabbrowser-tab.js | 30 +- browser/base/content/tabbrowser-tabs.js | 36 +- browser/base/content/tabbrowser.js | 15 +- browser/base/content/test/about/browser.toml | 10 +- .../content/test/about/browser_aboutNetError.js | 44 + .../content/test/contextMenu/browser_bug1798178.js | 2 +- .../browser_contextmenu_save_blocked.js | 2 +- browser/base/content/test/forms/browser.toml | 4 +- .../test/forms/browser_selectpopup_minFontSize.js | 38 + .../browser_beforeunload_duplicate_dialogs.js | 27 - .../base/content/test/general/browser_bug676619.js | 2 +- .../test/general/browser_double_close_tab.js | 46 +- .../base/content/test/general/browser_minimize.js | 43 +- .../test/general/browser_save_link-perwindowpb.js | 8 +- .../browser_save_link_when_window_navigates.js | 4 +- .../browser_save_private_link_perwindowpb.js | 2 +- .../content/test/general/browser_save_video.js | 4 +- .../test/general/browser_save_video_frame.js | 2 +- .../browser_visibleTabs_bookmarkAllPages.js | 4 +- .../general/navigating_window_with_download.html | 2 +- .../test/outOfProcess/browser_controller.js | 54 +- .../content/test/performance/browser_appmenu.js | 9 - .../browser_startup_content_mainthreadio.js | 7 + .../browser_popupNotification_security_delay.js | 165 + .../content/test/popups/browser_popup_blocker.js | 15 +- .../browser_private_browsing_simplified_ui.js | 15 - .../base/content/test/protectionsUI/browser.toml | 7 - .../test/protectionsUI/browser_protectionsUI.js | 119 +- .../browser_protectionsUI_report_breakage.js | 415 - browser/base/content/test/sanitize/browser.toml | 2 + .../test/sanitize/browser_sanitize-timespans.js | 3 - .../test/sanitize/browser_sanitizeDialog.js | 22 - .../test/sanitize/browser_sanitizeDialog_v2.js | 711 +- .../browser_sanitizeDialog_v2_dataSizes.js | 310 + .../browser_sanitizeOnShutdown_migration.js | 26 +- browser/base/content/test/sanitize/head.js | 366 + .../base/content/test/siteIdentity/browser.toml | 6 + .../browser_identity_web_controlled_blank.js | 128 + .../siteIdentity/test_web_controlled_blank.html | 36 + .../test/static/browser_all_files_referenced.js | 9 +- .../browser_misused_characters_in_strings.js | 22 + .../content/test/static/browser_parsable_css.js | 18 - .../test/tabPrompts/browser_beforeunload_urlbar.js | 30 +- .../test/tabPrompts/browser_confirmFolderUpload.js | 2 +- .../test/tabPrompts/browser_contentOrigins.js | 6 +- .../test/tabPrompts/browser_multiplePrompts.js | 72 +- .../browser_openPromptInBackgroundTab.js | 113 +- .../browser_tabdialogbox_content_prompts.js | 8 - browser/base/content/test/tabs/browser.toml | 1 - .../test/tabs/browser_close_during_beforeunload.js | 9 +- .../test/tabs/browser_multiselect_tabs_bookmark.js | 10 - .../base/content/test/tabs/browser_tab_preview.js | 71 +- .../browser_permissions_local_file.js | 2 +- browser/base/content/utilityOverlay.js | 37 +- browser/base/content/webext-panels.xhtml | 1 + browser/base/jar.mn | 1 + browser/base/moz.build | 4 - browser/base/triage-tabbrowser.json | 51 + browser/components/BrowserContentHandler.sys.mjs | 124 +- browser/components/BrowserGlue.sys.mjs | 308 +- browser/components/about/AboutRedirector.cpp | 8 + browser/components/about/components.conf | 2 + .../aboutlogins/AboutLoginsParent.sys.mjs | 11 +- .../aboutlogins/content/components/login-item.css | 2 +- .../aboutlogins/content/components/login-item.mjs | 2 +- .../aboutlogins/content/components/login-list.css | 2 +- .../browser_alertDismissedAfterChangingPassword.js | 4 +- .../tests/browser/browser_createLogin.js | 186 +- .../tests/browser/browser_loginListChanges.js | 2 +- .../tests/browser/browser_openExport.js | 2 +- .../tests/browser/browser_openImportCSV.js | 10 +- .../tests/browser/browser_updateLogin.js | 186 +- ...rowser_vulnerableLoginAddedInSecondaryWindow.js | 3 +- .../aboutlogins/tests/chrome/aboutlogins_common.js | 2 +- .../aboutlogins/tests/chrome/test_login_item.html | 2 +- browser/components/aboutwelcome/.eslintrc.js | 7 +- .../aboutwelcome/actors/AboutWelcomeChild.sys.mjs | 28 +- .../aboutwelcome/actors/AboutWelcomeParent.sys.mjs | 6 +- .../aboutwelcome/content-src/aboutwelcome.scss | 367 +- .../content-src/components/AddonsPicker.jsx | 4 +- .../components/EmbeddedMigrationWizard.jsx | 25 +- .../content-src/components/MSLocalized.jsx | 1 + .../components/MultiStageProtonScreen.jsx | 17 +- .../aboutwelcome/content/aboutwelcome.bundle.js | 107 +- .../aboutwelcome/content/aboutwelcome.css | 210 +- .../components/aboutwelcome/content/onboarding.ftl | 13 + browser/components/aboutwelcome/karma.mc.config.js | 39 +- .../aboutwelcome/modules/AWToolbarUtils.sys.mjs | 79 + browser/components/aboutwelcome/moz.build | 5 + browser/components/aboutwelcome/package-lock.json | 6651 +-- browser/components/aboutwelcome/package.json | 32 +- .../aboutwelcome/tests/browser/browser.toml | 5 + .../browser/browser_aboutwelcome_attribution.js | 2 - .../browser_aboutwelcome_configurable_ui.js | 104 +- ...rowser_aboutwelcome_multistage_experimentAPI.js | 208 - .../browser_aboutwelcome_multistage_transitions.js | 219 + .../tests/browser/browser_aboutwelcome_observer.js | 5 + .../browser/browser_aboutwelcome_toolbar_button.js | 64 + .../tests/unit/MultiStageAWProton.test.jsx | 103 + .../tests/xpcshell/test_AboutWelcomeAttribution.js | 69 + .../tests/xpcshell/test_AboutWelcomeTelemetry.js | 90 + .../xpcshell/test_AboutWelcomeTelemetry_glean.js | 238 + .../aboutwelcome/tests/xpcshell/xpcshell.toml | 9 + browser/components/asrouter/.eslintrc.js | 5 +- browser/components/asrouter/README.md | 23 - .../asrouter/actors/ASRouterChild.sys.mjs | 2 +- browser/components/asrouter/bin/import-rollouts.js | 2 +- .../asrouter/content-src/asrouter-utils.js | 79 - .../asrouter/content-src/asrouter-utils.mjs | 81 + .../components/ASRouterAdmin/ASRouterAdmin.jsx | 25 +- .../components/ASRouterAdmin/CopyButton.jsx | 2 +- .../ConditionalWrapper/ConditionalWrapper.jsx | 9 - .../ImpressionsWrapper/ImpressionsWrapper.jsx | 76 - .../schemas/MessagingExperiment.schema.json | 4 + .../asrouter/content-src/schemas/message-format.md | 111 - .../asrouter/content-src/styles/_shopping.scss | 1 + .../OnboardingMessage/Spotlight.schema.json | 4 + .../asrouter/content/asrouter-admin.bundle.js | 139 +- .../components/ASRouterAdmin/ASRouterAdmin.css | 21 +- browser/components/asrouter/docs/telemetry.md | 2 +- browser/components/asrouter/karma.mc.config.js | 63 +- .../components/asrouter/modules/ASRouter.sys.mjs | 22 +- .../asrouter/modules/ASRouterPreferences.sys.mjs | 2 +- .../asrouter/modules/ASRouterTargeting.sys.mjs | 2 +- .../modules/ASRouterTriggerListeners.sys.mjs | 8 +- .../asrouter/modules/CFRPageActions.sys.mjs | 2 +- .../asrouter/modules/FeatureCalloutBroker.sys.mjs | 2 +- .../modules/MessagingExperimentConstants.sys.mjs | 4 + .../modules/OnboardingMessageProvider.sys.mjs | 4 +- .../asrouter/modules/ToastNotification.sys.mjs | 2 +- .../asrouter/modules/ToolbarBadgeHub.sys.mjs | 2 +- browser/components/asrouter/package-lock.json | 7130 +-- browser/components/asrouter/package.json | 34 +- .../asrouter/tests/browser/browser_asrouter_cfr.js | 66 +- .../browser_asrouter_experimentsAPILoader.js | 2 +- .../tests/browser/browser_asrouter_targeting.js | 2 +- .../tests/browser/browser_feature_callout_panel.js | 2 +- .../tests/browser/browser_trigger_listeners.js | 4 +- browser/components/asrouter/tests/browser/head.js | 4 +- .../asrouter/tests/unit/ASRouterChild.test.js | 11 - .../asrouter/tests/unit/ASRouterTargeting.test.js | 4 +- .../asrouter/tests/unit/CFRPageActions.test.js | 6 +- .../asrouter/tests/unit/ModalOverlay.test.jsx | 69 - .../asrouter/tests/unit/TargetingDocs.test.js | 2 +- .../asrouter/tests/unit/ToolbarPanelHub.test.js | 18 +- .../asrouter/tests/unit/asrouter-utils.test.js | 36 +- .../components/asrouter/tests/unit/unit-entry.js | 14 +- .../asrouter/webpack.asrouter-admin.config.js | 2 +- browser/components/backup/.eslintrc.js | 9 + browser/components/backup/BackupResources.sys.mjs | 15 + browser/components/backup/BackupService.sys.mjs | 103 + browser/components/backup/docs/backup-service.rst | 8 + browser/components/backup/docs/index.rst | 13 + browser/components/backup/metrics.yaml | 30 + browser/components/backup/moz.build | 18 + .../backup/resources/BackupResource.sys.mjs | 109 + .../backup/tests/xpcshell/data/test_xulstore.json | 18 + .../backup/tests/xpcshell/test_BrowserResource.js | 63 + .../backup/tests/xpcshell/test_measurements.js | 40 + .../components/backup/tests/xpcshell/xpcshell.toml | 8 + .../content/ContentAnalysis.sys.mjs | 232 +- .../test/browser/browser_saveLink.js | 2 +- .../content/protectionsPanel.inc.xhtml | 82 - .../customizableui/CustomizableUI.sys.mjs | 23 +- .../customizableui/PanelMultiView.sys.mjs | 51 - ...1856572_ensure_Fluent_works_in_customizeMode.js | 43 +- .../components/downloads/DownloadsCommon.sys.mjs | 4 +- .../components/downloads/DownloadsViewUI.sys.mjs | 2 +- .../downloads/DownloadsViewableInternally.sys.mjs | 2 +- .../downloads/content/allDownloadsView.js | 6 +- .../downloads/content/contentAreaDownloadsView.js | 2 +- browser/components/downloads/content/downloads.js | 12 +- .../test/browser/browser_download_overwrite.js | 6 +- .../browser/browser_downloads_panel_dontshow.js | 2 +- .../test/browser/browser_downloads_panel_opens.js | 2 +- .../browser/browser_iframe_gone_mid_download.js | 2 +- .../test/browser/browser_image_mimetype_issues.js | 6 +- .../test/browser/browser_library_clearall.js | 2 +- .../test/unit/test_DownloadsCommon_isFileOfType.js | 2 +- .../components/enterprisepolicies/Policies.sys.mjs | 71 +- .../enterprisepolicies/content/aboutPolicies.js | 12 +- .../helpers/BookmarksPolicies.sys.mjs | 4 +- .../helpers/ProxyPolicies.sys.mjs | 2 +- .../schemas/policies-schema.json | 38 + .../browser_policy_allowfileselectiondialogs.js | 2 +- .../tests/xpcshell/test_policy_search_engine.js | 2 +- .../tests/xpcshell/test_simple_pref_policies.js | 13 + .../extensions/ExtensionBrowsingData.sys.mjs | 2 +- .../extensions/ExtensionControlledPopup.sys.mjs | 2 +- .../components/extensions/ExtensionPopups.sys.mjs | 4 +- .../components/extensions/child/ext-devtools.js | 2 +- browser/components/extensions/child/ext-menus.js | 2 +- .../components/extensions/parent/ext-browser.js | 2 +- .../extensions/parent/ext-browserAction.js | 4 +- .../parent/ext-chrome-settings-overrides.js | 2 +- .../components/extensions/parent/ext-commands.js | 2 +- .../extensions/parent/ext-devtools-panels.js | 2 +- .../components/extensions/parent/ext-devtools.js | 2 +- .../components/extensions/parent/ext-history.js | 2 +- browser/components/extensions/parent/ext-menus.js | 4 +- .../components/extensions/parent/ext-omnibox.js | 6 +- .../components/extensions/parent/ext-pageAction.js | 6 +- browser/components/extensions/parent/ext-search.js | 2 +- .../extensions/parent/ext-sidebarAction.js | 2 +- browser/components/extensions/parent/ext-tabs.js | 16 +- .../components/extensions/parent/ext-topSites.js | 2 +- .../extensions/parent/ext-url-overrides.js | 2 +- .../components/extensions/parent/ext-windows.js | 2 +- .../extensions/test/AppUiTestDelegate.sys.mjs | 4 +- .../extensions/test/browser/browser.toml | 51 +- .../browser/browser_AMBrowserExtensionsImport.js | 4 +- .../browser/browser_ExtensionControlledPopup.js | 4 +- .../browser_ext_browserAction_click_types.js | 2 +- .../browser/browser_ext_browserAction_context.js | 4 +- .../browser_ext_browserAction_contextMenu.js | 2 +- .../browser_ext_browserAction_experiment.js | 4 +- ...xt_browserAction_pageAction_icon_permissions.js | 4 +- .../browser_ext_browserAction_popup_preload.js | 4 +- .../test/browser/browser_ext_contextMenus.js | 6 +- .../browser/browser_ext_contextMenus_bookmarks.js | 2 +- .../browser/browser_ext_contextMenus_commands.js | 2 +- .../browser_ext_contextMenus_targetUrlPatterns.js | 2 +- .../browser_ext_devtools_inspectedWindow.js | 2 +- ...r_ext_devtools_inspectedWindow_eval_bindings.js | 2 +- .../browser_ext_devtools_inspectedWindow_reload.js | 2 +- .../test/browser/browser_ext_devtools_page.js | 4 +- .../test/browser/browser_ext_menus_accesskey.js | 2 +- .../browser/browser_ext_menus_targetElement.js | 4 +- .../test/browser/browser_ext_mousewheel_zoom.js | 4 +- .../test/browser/browser_ext_openPanel.js | 2 +- .../test/browser/browser_ext_optionsPage_modals.js | 86 +- .../browser/browser_ext_pageAction_click_types.js | 2 +- .../test/browser/browser_ext_popup_focus.js | 4 +- .../test/browser/browser_ext_search_favicon.js | 14 +- .../browser_ext_sessions_getRecentlyClosed_tabs.js | 2 +- .../test/browser/browser_ext_sessions_restore.js | 2 +- .../browser/browser_ext_sessions_restoreTab.js | 4 +- .../browser_ext_sessions_window_tab_value.js | 2 +- ...rowser_ext_settings_overrides_default_search.js | 20 +- .../test/browser/browser_ext_sidebarAction.js | 61 +- .../browser/browser_ext_tabs_autoDiscardable.js | 2 +- .../browser/browser_ext_tabs_discard_reversed.js | 2 +- .../test/browser/browser_ext_tabs_duplicate.js | 10 +- .../test/browser/browser_ext_tabs_events.js | 14 +- .../test/browser/browser_ext_tabs_executeScript.js | 12 +- .../browser/browser_ext_tabs_executeScript_good.js | 4 +- .../test/browser/browser_ext_tabs_hide.js | 2 +- .../test/browser/browser_ext_tabs_hide_update.js | 2 +- .../test/browser/browser_ext_tabs_insertCSS.js | 4 +- .../browser/browser_ext_tabs_move_discarded.js | 2 +- .../browser/browser_ext_tabs_newtab_private.js | 2 +- .../test/browser/browser_ext_tabs_onCreated.js | 2 +- .../test/browser/browser_ext_tabs_onUpdated.js | 4 +- .../browser/browser_ext_tabs_onUpdated_filter.js | 4 +- .../test/browser/browser_ext_tabs_query.js | 2 +- .../test/browser/browser_ext_tabs_saveAsPDF.js | 6 +- .../test/browser/browser_ext_tabs_sendMessage.js | 6 +- .../test/browser/browser_ext_tabs_sharingState.js | 2 +- ...ext_webRequest_error_after_stopped_or_closed.js | 2 +- .../browser/browser_ext_windows_create_tabId.js | 3 +- .../test/browser/browser_ext_windows_update.js | 4 +- ...wser_unified_extensions_overflowable_toolbar.js | 16 +- browser/components/extensions/test/browser/head.js | 8 +- .../browser/search-engines/search-config-v2.json | 97 + .../xpcshell/test_ext_browsingData_settings.js | 4 +- .../test_ext_chrome_settings_overrides_update.js | 8 +- .../extensions/test/xpcshell/test_ext_history.js | 4 +- .../test_ext_homepage_overrides_private.js | 2 +- .../test_ext_settings_overrides_defaults.js | 182 +- .../xpcshell/test_ext_settings_overrides_search.js | 6 +- .../test_ext_settings_overrides_search_mozParam.js | 132 +- browser/components/firefoxview/OpenTabs.sys.mjs | 18 +- .../firefoxview/content/category-history.svg | 6 - .../firefoxview/content/category-opentabs.svg | 6 - .../content/category-recentbrowsing.svg | 7 - .../content/category-recentlyclosed.svg | 7 - .../firefoxview/content/category-syncedtabs.svg | 6 - .../firefoxview/content/view-history.svg | 6 + .../firefoxview/content/view-opentabs.svg | 6 + .../firefoxview/content/view-recentbrowsing.svg | 7 + .../firefoxview/content/view-recentlyclosed.svg | 7 + .../firefoxview/content/view-syncedtabs.svg | 6 + browser/components/firefoxview/firefoxview.css | 46 +- browser/components/firefoxview/firefoxview.html | 59 +- browser/components/firefoxview/firefoxview.mjs | 56 +- .../firefoxview/fxview-category-button.css | 125 - .../firefoxview/fxview-category-navigation.css | 60 - .../firefoxview/fxview-category-navigation.mjs | 150 - browser/components/firefoxview/fxview-tab-list.css | 29 +- browser/components/firefoxview/fxview-tab-list.mjs | 496 +- browser/components/firefoxview/fxview-tab-row.css | 91 +- browser/components/firefoxview/history.mjs | 6 +- browser/components/firefoxview/jar.mn | 13 +- browser/components/firefoxview/opentabs.mjs | 252 +- browser/components/firefoxview/recentlyclosed.mjs | 1 + browser/components/firefoxview/syncedtabs.mjs | 3 +- .../tests/browser/FirefoxViewTestUtils.sys.mjs | 17 +- .../firefoxview/tests/browser/browser.toml | 45 +- .../browser_dragDrop_after_opening_fxViewTab.js | 1 + .../tests/browser/browser_firefoxview.js | 5 +- .../browser_firefoxview_general_telemetry.js | 42 +- .../browser/browser_firefoxview_navigation.js | 54 +- .../tests/browser/browser_firefoxview_paused.js | 106 +- .../browser_firefoxview_search_telemetry.js | 18 +- .../tests/browser/browser_firefoxview_tab.js | 6 - .../browser/browser_firefoxview_virtual_list.js | 2 +- .../tests/browser/browser_history_firefoxview.js | 75 +- .../tests/browser/browser_opentabs_cards.js | 431 +- .../tests/browser/browser_opentabs_changes.js | 7 +- .../tests/browser/browser_opentabs_firefoxview.js | 159 +- .../tests/browser/browser_opentabs_more.js | 151 + .../tests/browser/browser_opentabs_pinned_tabs.js | 481 + .../tests/browser/browser_opentabs_recency.js | 31 +- .../tests/browser/browser_opentabs_search.js | 161 + .../browser/browser_opentabs_tab_indicators.js | 128 +- .../browser/browser_recentlyclosed_firefoxview.js | 18 +- .../browser_syncedtabs_errors_firefoxview.js | 4 +- .../browser/browser_syncedtabs_firefoxview.js | 20 +- .../browser_tab_list_keyboard_navigation.js | 334 + .../components/firefoxview/tests/browser/head.js | 83 +- .../firefoxview/tests/chrome/chrome.toml | 2 - .../chrome/test_fxview_category_navigation.html | 322 - .../tests/chrome/test_fxview_tab_list.html | 4 +- browser/components/firefoxview/viewpage.mjs | 28 +- .../migration/ChromeProfileMigrator.sys.mjs | 2 +- .../migration/EdgeProfileMigrator.sys.mjs | 4 +- .../components/migration/MigrationUtils.sys.mjs | 3 +- .../migration/MigrationWizardParent.sys.mjs | 12 +- .../migration/SafariProfileMigrator.sys.mjs | 2 +- .../migration/content/migration-wizard.mjs | 155 +- .../components/migration/docs/migration-wizard.rst | 17 + .../tests/browser/browser_file_migration.js | 2 +- .../tests/browser/browser_safari_passwords.js | 2 +- .../tests/chrome/test_migration_wizard.html | 254 + .../tests/marionette/test_refresh_firefox.py | 16 +- .../tests/unit/test_Chrome_permissions.js | 2 +- .../tests/unit/test_Safari_permissions.js | 2 +- browser/components/moz.build | 3 + browser/components/newtab/.eslintrc.js | 5 +- .../components/newtab/AboutNewTabService.sys.mjs | 4 +- .../newtab/components/CustomElements/paragraph.js | 2 +- .../newtab/content-src/components/Base/Base.jsx | 15 +- .../CollapsibleSection/CollapsibleSection.jsx | 17 +- .../components/ContextMenu/ContextMenuButton.jsx | 2 +- .../ContentSection/ContentSection.jsx | 19 + .../components/CustomizeMenu/CustomizeMenu.jsx | 1 + .../components/CustomizeMenu/_CustomizeMenu.scss | 35 + .../DiscoveryStreamAdmin/DiscoveryStreamAdmin.jsx | 2 +- .../DiscoveryStreamBase/DiscoveryStreamBase.jsx | 7 +- .../CardGrid/CardGrid.jsx | 8 +- .../DiscoveryStreamComponents/DSCard/DSCard.jsx | 76 +- .../DiscoveryStreamComponents/DSCard/_DSCard.scss | 32 +- .../DSContextFooter/DSContextFooter.jsx | 9 + .../DSContextFooter/_DSContextFooter.scss | 3 + .../DSPrivacyModal/DSPrivacyModal.jsx | 6 +- .../FeatureHighlight/FeatureHighlight.jsx | 74 + .../FeatureHighlight/SponsoredContentHighlight.jsx | 34 + .../FeatureHighlight/_FeatureHighlight.scss | 98 + .../_SponsoredContentHighlight.scss | 33 + .../SafeAnchor/SafeAnchor.jsx | 9 +- .../components/ErrorBoundary/ErrorBoundary.jsx | 2 +- .../content-src/components/TopSites/TopSite.jsx | 79 +- .../content-src/components/TopSites/TopSites.jsx | 2 +- .../content-src/components/TopSites/_TopSites.scss | 19 +- .../newtab/content-src/lib/init-store.js | 2 +- .../newtab/content-src/lib/link-menu-options.js | 2 +- .../newtab/content-src/lib/selectLayoutRender.js | 2 +- .../content-src/styles/_activity-stream.scss | 2 + .../newtab/content-src/styles/_icons.scss | 4 + .../newtab/css/activity-stream-linux.css | 176 +- .../components/newtab/css/activity-stream-mac.css | 176 +- .../newtab/css/activity-stream-windows.css | 176 +- .../newtab/data/content/activity-stream.bundle.js | 290 +- .../data/content/assets/sponsor-message-icon.svg | 6 + browser/components/newtab/docs/index.rst | 2 +- .../newtab/docs/v2-system-addon/preferences.md | 2 +- .../docs/v2-system-addon/unit_testing_guide.md | 8 +- browser/components/newtab/karma.mc.config.js | 8 - .../components/newtab/lib/ActivityStream.sys.mjs | 4 +- .../lib/ActivityStreamMessageChannel.sys.mjs | 2 +- .../newtab/lib/DiscoveryStreamFeed.sys.mjs | 19 +- .../components/newtab/lib/DownloadsManager.sys.mjs | 2 +- .../lib/PersonalityProvider/RecipeExecutor.mjs | 4 +- browser/components/newtab/lib/PrefsFeed.sys.mjs | 4 +- .../newtab/lib/RecommendationProvider.sys.mjs | 2 +- .../components/newtab/lib/SectionsManager.sys.mjs | 4 +- browser/components/newtab/lib/Store.sys.mjs | 2 +- .../components/newtab/lib/TelemetryFeed.sys.mjs | 10 +- browser/components/newtab/lib/TopSitesFeed.sys.mjs | 6 +- browser/components/newtab/loaders/inject-loader.js | 59 - browser/components/newtab/metrics.yaml | 21 + browser/components/newtab/package-lock.json | 230 +- browser/components/newtab/package.json | 6 - .../newtab/test/browser/browser_newtab_ping.js | 2 +- browser/components/newtab/test/schemas/pings.js | 2 +- .../DiscoveryStreamComponents/DSCard.test.jsx | 8 +- .../FeatureHighlight.test.jsx | 60 + .../content-src/components/ModalOverlay.test.jsx | 69 + .../unit/content-src/components/TopSites.test.jsx | 52 +- .../newtab/test/unit/lib/AboutPreferences.test.js | 2 +- .../newtab/test/unit/lib/ActivityStream.test.js | 10 +- .../PersonalityProvider.test.js | 4 +- .../lib/PersonalityProvider/RecipeExecutor.test.js | 2 +- browser/components/newtab/test/unit/unit-entry.js | 14 +- browser/components/newtab/test/unit/utils.js | 10 +- .../test/xpcshell/test_AboutWelcomeAttribution.js | 69 - .../test/xpcshell/test_AboutWelcomeTelemetry.js | 90 - .../xpcshell/test_AboutWelcomeTelemetry_glean.js | 238 - .../newtab/test/xpcshell/test_HighlightsFeed.js | 4 +- .../newtab/test/xpcshell/test_PlacesFeed.js | 10 +- .../components/newtab/test/xpcshell/test_Store.js | 2 +- .../newtab/test/xpcshell/test_TelemetryFeed.js | 32 + .../components/newtab/test/xpcshell/xpcshell.toml | 6 - .../components/newtab/tools/resourceUriPlugin.js | 9 +- .../newtab/webpack.system-addon.config.js | 3 - .../browser/browser_firstPartyIsolation_saveAs.js | 3 +- .../test/browser/browser_httpauth.js | 19 +- browser/components/places/Interactions.sys.mjs | 15 +- browser/components/places/PlacesUIUtils.sys.mjs | 8 +- .../places/content/browserPlacesViews.js | 12 +- browser/components/places/content/controller.js | 10 +- .../components/places/content/places-menupopup.js | 2 +- browser/components/places/content/places-tree.js | 8 +- browser/components/places/content/places.js | 8 +- browser/components/places/content/treeView.js | 26 +- browser/components/places/docs/Bookmarks.rst | 6 +- browser/components/places/docs/History.rst | 6 +- .../places/docs/architecture-overview.rst | 2 +- .../components/places/tests/browser/browser.toml | 9 +- .../browser/browser_autoshow_bookmarks_toolbar.js | 6 +- .../browser_bookmarkProperties_no_user_actions.js | 4 +- .../tests/browser/browser_bookmark_all_tabs.js | 46 - .../browser_bookmark_backup_export_import.js | 2 +- .../browser_bookmark_context_menu_contents.js | 14 +- .../tests/browser/browser_bookmark_current_tabs.js | 71 + .../places/tests/browser/browser_bookmark_popup.js | 14 +- .../tests/browser/browser_bookmarksProperties.js | 6 +- .../browser/browser_click_bookmarks_on_toolbar.js | 4 +- .../tests/browser/browser_controller_onDrop.js | 4 +- .../browser/browser_controller_onDrop_query.js | 4 +- .../browser/browser_controller_onDrop_sidebar.js | 8 +- .../browser/browser_controller_onDrop_tagFolder.js | 4 +- .../places/tests/browser/browser_library_delete.js | 42 +- .../browser_library_delete_bookmarks_in_tags.js | 2 +- .../browser/browser_panelview_bookmarks_delete.js | 2 +- .../browser/browser_sidebar_open_bookmarks.js | 2 +- .../tests/browser/browser_sidebarpanels_click.js | 4 +- .../tests/browser/browser_toolbar_overflow.js | 2 +- browser/components/places/tests/browser/head.js | 4 +- .../interactions/browser_interactions_typing.js | 2 +- .../interactions/browser_interactions_view_time.js | 4 +- .../tests/unit/test_clearHistory_shutdown.js | 2 +- browser/components/preferences/containers.js | 2 +- .../components/preferences/dialogs/addEngine.js | 2 +- .../components/preferences/dialogs/blocklists.js | 14 +- .../preferences/dialogs/clearSiteData.js | 2 +- .../components/preferences/dialogs/colors.xhtml | 10 +- .../components/preferences/dialogs/connection.js | 10 + .../preferences/dialogs/connection.xhtml | 14 +- .../components/preferences/dialogs/containers.js | 4 +- .../preferences/dialogs/dohExceptions.js | 1 - browser/components/preferences/dialogs/fonts.xhtml | 4 +- .../preferences/dialogs/translationExceptions.js | 20 +- .../components/preferences/dialogs/translations.js | 20 +- browser/components/preferences/findInPage.js | 43 +- browser/components/preferences/home.js | 18 +- browser/components/preferences/main.inc.xhtml | 13 +- browser/components/preferences/main.js | 26 +- browser/components/preferences/preferences.js | 9 +- browser/components/preferences/preferences.xhtml | 3 +- browser/components/preferences/privacy.inc.xhtml | 9 +- browser/components/preferences/privacy.js | 13 +- browser/components/preferences/search.js | 1121 +- browser/components/preferences/sync.js | 2 +- browser/components/preferences/tests/browser.toml | 4 + .../preferences/tests/browser_about_settings.js | 29 + .../tests/browser_basic_rebuild_fonts_test.js | 2 +- .../tests/browser_browser_languages_subdialog.js | 20 +- .../preferences/tests/browser_cert_export.js | 2 +- .../preferences/tests/browser_connection.js | 2 +- .../tests/browser_connection_bug388287.js | 2 +- .../tests/browser_cookies_exceptions.js | 26 +- .../browser_dns_over_https_exceptions_subdialog.js | 185 + .../components/preferences/tests/browser_fluent.js | 4 +- .../tests/browser_localSearchShortcuts.js | 4 +- .../tests/browser_permissions_urlFieldHidden.js | 2 +- .../preferences/tests/browser_proxy_backup.js | 2 +- .../tests/browser_searchChangedEngine.js | 11 + .../tests/browser_search_within_preferences_2.js | 84 + .../tests/browser_sync_chooseWhatToSync.js | 2 +- .../preferences/tests/browser_sync_pairing.js | 2 +- .../tests/browser_trendingsuggestions.js | 17 + browser/components/preferences/tests/head.js | 2 +- .../tests/siteData/browser_clearSiteData.js | 2 +- .../components/preferences/tests/siteData/head.js | 2 +- .../tests/siteData/service_worker_test.html | 2 +- .../components/preferences/translations.inc.xhtml | 7 +- .../test/browser/browser_privatebrowsing_about.js | 27 +- .../browser_privatebrowsing_downloadLastDir.js | 2 +- .../browser_privatebrowsing_downloadLastDir_c.js | 2 +- browser/components/profiles/ProfilesChild.sys.mjs | 5 + browser/components/profiles/ProfilesParent.sys.mjs | 5 + browser/components/profiles/content/profiles.ftl | 16 + browser/components/profiles/content/profiles.html | 20 + browser/components/profiles/jar.mn | 6 + browser/components/profiles/moz.build | 15 + .../WebProtocolHandlerRegistrar.sys.mjs | 403 +- browser/components/protocolhandler/metrics.yaml | 2 + .../reportbrokensite/ReportBrokenSite.sys.mjs | 12 +- .../reportbrokensite/test/browser/browser.toml | 2 - .../browser/browser_site_not_working_fallback.js | 35 - .../test/browser/browser_tab_key_order.js | 2 + .../reportbrokensite/test/browser/head.js | 21 +- .../reportbrokensite/test/browser/send.js | 24 +- .../test/browser/send_more_info.js | 52 +- .../test/mochitest/test_keyboard_event.html | 13 +- .../screenshots/ScreenshotsOverlayChild.sys.mjs | 3 +- .../screenshots/ScreenshotsUtils.sys.mjs | 168 +- browser/components/screenshots/fileHelpers.mjs | 2 +- .../screenshots/tests/browser/browser.toml | 10 + .../browser_screenshots_drag_scroll_test.js | 17 + .../browser/browser_screenshots_test_downloads.js | 2 +- .../browser/browser_screenshots_test_full_page.js | 105 +- .../browser_screenshots_test_toggle_pref.js | 97 +- .../browser/browser_screenshots_test_visible.js | 206 +- .../browser_test_moving_tab_to_new_window.js | 123 + .../components/screenshots/tests/browser/head.js | 39 +- .../search/DomainToCategoriesMap.worker.mjs | 101 + browser/components/search/SearchOneOffs.sys.mjs | 12 +- .../components/search/SearchSERPTelemetry.sys.mjs | 305 +- .../search/content/autocomplete-popup.js | 6 +- .../components/search/content/contentSearchUI.js | 4 +- browser/components/search/content/searchbar.js | 18 +- browser/components/search/metrics.yaml | 14 +- browser/components/search/moz.build | 1 + browser/components/search/pings.yaml | 24 + .../search/schema/search-telemetry-schema.json | 39 +- .../search/test/browser/browser_426329.js | 2 +- .../search/test/browser/browser_contentSearch.js | 14 +- .../search/test/browser/browser_contentSearchUI.js | 44 +- .../browser/browser_contentSearchUI_default.js | 25 +- .../test/browser/browser_defaultPrivate_nimbus.js | 45 +- .../search/test/browser/browser_google_behavior.js | 4 +- .../browser_oneOffContextMenu_setDefault.js | 4 +- .../test/browser/browser_rich_suggestions.js | 56 +- .../test/browser/browser_searchEngine_behaviors.js | 12 +- .../browser_searchbar_keyboard_navigation.js | 16 +- .../test/browser/browser_searchbar_openpopup.js | 9 +- .../test/browser/browser_trending_suggestions.js | 63 +- .../search/test/browser/contentSearchUI.html | 3 + browser/components/search/test/browser/head.js | 2 +- .../search/test/browser/telemetry/browser.toml | 30 +- ...ry_categorization_enabled_by_nimbus_variable.js | 2 +- ...wser_search_telemetry_adImpression_component.js | 41 + ...ry_adImpression_component_skipCount_children.js | 149 + ...etry_adImpression_component_skipCount_parent.js | 134 + ...ch_telemetry_domain_categorization_ad_values.js | 2 +- ...lemetry_domain_categorization_download_timer.js | 6 +- ...h_telemetry_domain_categorization_extraction.js | 191 +- ...earch_telemetry_domain_categorization_region.js | 2 +- ...ch_telemetry_domain_categorization_reporting.js | 2 +- ...emetry_domain_categorization_reporting_timer.js | 2 +- ...domain_categorization_reporting_timer_wakeup.js | 2 +- .../browser_search_telemetry_engagement_content.js | 8 +- ...telemetry_engagement_eventListeners_children.js | 480 + ...h_telemetry_engagement_eventListeners_parent.js | 434 + ...earch_telemetry_engagement_ignoreLinkRegexps.js | 223 + ...lemetry_engagement_nonAdsLinkQueryParamNames.js | 252 + .../browser_search_telemetry_engagement_target.js | 174 + ...rowser_search_telemetry_sources_webextension.js | 4 +- .../telemetry/domain_category_mappings.json | 8 - .../search/test/browser/telemetry/head.js | 83 +- ...searchTelemetryAd_components_cookie_banner.html | 16 + .../searchTelemetryAd_searchbox_with_content.html | 9 +- ...lemetryAd_searchbox_with_redirecting_links.html | 40 + .../telemetry/searchTelemetryDomainExtraction.html | 179 +- .../telemetry/searchTelemetrySinglePageApp.html | 4 +- .../searchTelemetry_redirect_with_js.html | 25 + .../test/unit/domain_category_mappings_1a.json | 3 - .../test/unit/domain_category_mappings_1b.json | 3 - .../test/unit/domain_category_mappings_2a.json | 3 - .../test/unit/domain_category_mappings_2b.json | 3 - .../test_search_telemetry_categorization_logic.js | 225 +- ...rch_telemetry_categorization_process_domains.js | 89 - .../test_search_telemetry_categorization_sync.js | 66 +- browser/components/search/test/unit/xpcshell.toml | 8 - browser/components/shell/WindowsUserChoice.cpp | 13 + browser/components/shell/WindowsUserChoice.h | 9 + .../components/shopping/content/letter-grade.css | 2 +- .../shopping/content/shopping-container.css | 2 +- .../shopping/content/shopping-sidebar.js | 2 - browser/components/sidebar/jar.mn | 5 + browser/components/sidebar/moz.build | 7 + browser/components/storybook/.babelrc.json | 5 + .../addon-component-status/StatusIndicator.jsx | 114 + .../addon-component-status/StatusIndicator.mjs | 114 - .../addon-component-status/preset/manager.mjs | 6 +- .../.storybook/addon-fluent/FluentPanel.jsx | 110 + .../.storybook/addon-fluent/FluentPanel.mjs | 121 - .../addon-fluent/PseudoLocalizationButton.jsx | 55 + .../addon-fluent/PseudoLocalizationButton.mjs | 55 - .../.storybook/addon-fluent/fluent-panel.css | 64 +- .../.storybook/addon-fluent/preset/manager.mjs | 13 +- .../addon-fluent/withPseudoLocalization.mjs | 11 +- browser/components/storybook/.storybook/main.js | 49 +- .../storybook/.storybook/markdown-story-indexer.js | 50 + .../storybook/.storybook/markdown-story-loader.js | 123 +- .../storybook/.storybook/markdown-story-utils.js | 197 + .../storybook/.storybook/preview-head.html | 9 + .../components/storybook/.storybook/preview.mjs | 30 +- .../storybook/docs/README.typography.stories.md | 10 +- browser/components/storybook/package-lock.json | 44491 +++++++------------ browser/components/storybook/package.json | 24 +- .../storybook/stories/button.stories.mjs | 3 + .../stories/fxview-category-navigation.stories.mjs | 113 - .../storybook/stories/fxview-tab-list.stories.md | 14 +- .../storybook/stories/migration-wizard.stories.mjs | 66 +- browser/components/syncedtabs/TabListView.sys.mjs | 18 +- browser/components/tabpreview/tabpreview.css | 42 +- browser/components/tabpreview/tabpreview.mjs | 32 +- browser/components/tests/browser/browser.toml | 6 +- .../browser_default_webprotocol_handler_mailto.js | 117 + .../browser_system_notification_telemetry.js | 54 - .../tests/browser/whats_new_page/browser.toml | 2 + .../browser_whats_new_page_nimbus.js | 109 + .../browser_whats_new_page_nimbus.toml | 6 + .../content/TranslationsPanelShared.sys.mjs | 122 + .../content/fullPageTranslationsPanel.inc.xhtml | 146 + .../content/fullPageTranslationsPanel.js | 1542 + .../content/selectTranslationsPanel.inc.xhtml | 102 + .../content/selectTranslationsPanel.js | 220 + .../content/translationsPanel.inc.xhtml | 145 - .../translations/content/translationsPanel.js | 1630 - browser/components/translations/jar.mn | 4 +- .../translations/tests/browser/browser.toml | 96 +- ...wser_translations_full_page_panel_a11y_focus.js | 32 + ...age_panel_always_translate_language_bad_data.js | 39 + ...l_page_panel_always_translate_language_basic.js | 79 + ..._page_panel_always_translate_language_manual.js | 80 + ...page_panel_always_translate_language_restore.js | 101 + ...page_panel_app_menu_never_translate_language.js | 40 + ...ull_page_panel_app_menu_never_translate_site.js | 140 + ...ns_full_page_panel_auto_translate_error_view.js | 86 + ..._full_page_panel_auto_translate_revisit_view.js | 86 + .../browser_translations_full_page_panel_basics.js | 69 + .../browser_translations_full_page_panel_button.js | 77 + .../browser_translations_full_page_panel_cancel.js | 27 + ..._translate_language_with_translations_active.js | 147 + ...ranslate_language_with_translations_inactive.js | 93 + ..._page_panel_close_panel_never_translate_site.js | 159 + ..._translations_full_page_panel_engine_destroy.js | 55 + ...tions_full_page_panel_engine_destroy_pending.js | 72 + ...nslations_full_page_panel_engine_unsupported.js | 59 + ...ions_full_page_panel_engine_unsupported_lang.js | 28 + ...rowser_translations_full_page_panel_firstrun.js | 33 + ...ranslations_full_page_panel_firstrun_revisit.js | 57 + ...browser_translations_full_page_panel_fuzzing.js | 240 + .../browser_translations_full_page_panel_gear.js | 32 + ...ons_full_page_panel_never_translate_language.js | 186 + ...lations_full_page_panel_never_translate_site.js | 247 + ...ns_full_page_panel_never_translate_site_auto.js | 109 + ...s_full_page_panel_never_translate_site_basic.js | 62 + ..._full_page_panel_never_translate_site_manual.js | 84 + .../browser_translations_full_page_panel_retry.js | 54 + ...ns_full_page_panel_settings_unsupported_lang.js | 74 + ...ranslations_full_page_panel_switch_languages.js | 70 + .../browser_translations_full_page_reader_mode.js | 115 + ..._full_page_telemetry_firstrun_auto_translate.js | 117 + ...slations_full_page_telemetry_firstrun_basics.js | 93 + ..._page_telemetry_firstrun_translation_failure.js | 149 + ...ull_page_telemetry_firstrun_unsupported_lang.js | 122 + ..._translations_full_page_telemetry_open_panel.js | 85 + ...lations_full_page_telemetry_panel_auto_offer.js | 83 + ...ull_page_telemetry_panel_auto_offer_settings.js | 110 + ...lations_full_page_telemetry_switch_languages.js | 156 + ...ions_full_page_telemetry_translation_failure.js | 212 + ...ions_full_page_telemetry_translation_request.js | 170 + .../browser_translations_panel_a11y_focus.js | 32 - ...ons_panel_always_translate_language_bad_data.js | 40 - ...ations_panel_always_translate_language_basic.js | 79 - ...tions_panel_always_translate_language_manual.js | 80 - ...ions_panel_always_translate_language_restore.js | 101 - ...ions_panel_app_menu_never_translate_language.js | 40 - ...slations_panel_app_menu_never_translate_site.js | 140 - ...translations_panel_auto_translate_error_view.js | 86 - ...anslations_panel_auto_translate_revisit_view.js | 86 - .../browser/browser_translations_panel_basics.js | 69 - .../browser/browser_translations_panel_button.js | 77 - .../browser/browser_translations_panel_cancel.js | 27 - ..._translate_language_with_translations_active.js | 147 - ...ranslate_language_with_translations_inactive.js | 93 - ...tions_panel_close_panel_never_translate_site.js | 159 - .../browser_translations_panel_engine_destroy.js | 55 - ...er_translations_panel_engine_destroy_pending.js | 72 - ...rowser_translations_panel_engine_unsupported.js | 59 - ...r_translations_panel_engine_unsupported_lang.js | 28 - .../browser/browser_translations_panel_firstrun.js | 33 - .../browser_translations_panel_firstrun_revisit.js | 57 - .../browser/browser_translations_panel_fuzzing.js | 240 - .../browser/browser_translations_panel_gear.js | 32 - ..._translations_panel_never_translate_language.js | 186 - ...wser_translations_panel_never_translate_site.js | 247 - ...translations_panel_never_translate_site_auto.js | 109 - ...ranslations_panel_never_translate_site_basic.js | 62 - ...anslations_panel_never_translate_site_manual.js | 84 - .../browser/browser_translations_panel_retry.js | 54 - ...translations_panel_settings_unsupported_lang.js | 74 - .../browser_translations_panel_switch_languages.js | 70 - .../browser/browser_translations_reader_mode.js | 115 - ...text_menu_with_full_page_translations_active.js | 8 +- ...translations_select_panel_language_selectors.js | 54 + ...rowser_translations_select_panel_mainview_ui.js | 36 + ...anslations_telemetry_firstrun_auto_translate.js | 117 - ...owser_translations_telemetry_firstrun_basics.js | 93 - ...tions_telemetry_firstrun_translation_failure.js | 149 - ...slations_telemetry_firstrun_unsupported_lang.js | 122 - .../browser_translations_telemetry_open_panel.js | 85 - ...wser_translations_telemetry_panel_auto_offer.js | 83 - ...slations_telemetry_panel_auto_offer_settings.js | 110 - ...wser_translations_telemetry_switch_languages.js | 156 - ...r_translations_telemetry_translation_failure.js | 212 - ...r_translations_telemetry_translation_request.js | 170 - .../components/translations/tests/browser/head.js | 604 +- browser/components/uitour/test/browser.toml | 20 +- .../urlbar/QuickActionsLoaderDefault.sys.mjs | 9 + browser/components/urlbar/UrlbarController.sys.mjs | 132 +- .../components/urlbar/UrlbarEventBufferer.sys.mjs | 4 +- browser/components/urlbar/UrlbarInput.sys.mjs | 153 +- browser/components/urlbar/UrlbarPrefs.sys.mjs | 8 +- .../urlbar/UrlbarProviderAboutPages.sys.mjs | 2 +- .../urlbar/UrlbarProviderAliasEngines.sys.mjs | 3 +- .../urlbar/UrlbarProviderAutofill.sys.mjs | 44 +- .../urlbar/UrlbarProviderCalculator.sys.mjs | 4 +- .../urlbar/UrlbarProviderClipboard.sys.mjs | 5 +- .../urlbar/UrlbarProviderContextualSearch.sys.mjs | 14 +- .../urlbar/UrlbarProviderHeuristicFallback.sys.mjs | 23 +- .../urlbar/UrlbarProviderInputHistory.sys.mjs | 55 +- .../urlbar/UrlbarProviderInterventions.sys.mjs | 7 +- .../urlbar/UrlbarProviderOmnibox.sys.mjs | 4 +- .../urlbar/UrlbarProviderOpenTabs.sys.mjs | 94 +- .../components/urlbar/UrlbarProviderPlaces.sys.mjs | 4 +- .../urlbar/UrlbarProviderPrivateSearch.sys.mjs | 3 +- .../urlbar/UrlbarProviderQuickActions.sys.mjs | 4 +- .../urlbar/UrlbarProviderQuickSuggest.sys.mjs | 17 +- ...lbarProviderQuickSuggestContextualOptIn.sys.mjs | 8 +- .../urlbar/UrlbarProviderRemoteTabs.sys.mjs | 2 +- .../urlbar/UrlbarProviderSearchSuggestions.sys.mjs | 6 +- .../urlbar/UrlbarProviderSearchTips.sys.mjs | 9 +- .../urlbar/UrlbarProviderTabToSearch.sys.mjs | 15 +- .../urlbar/UrlbarProviderTokenAliasEngines.sys.mjs | 21 +- .../urlbar/UrlbarProviderTopSites.sys.mjs | 100 +- .../urlbar/UrlbarProviderUnitConversion.sys.mjs | 2 +- .../urlbar/UrlbarProviderWeather.sys.mjs | 6 +- .../components/urlbar/UrlbarSearchOneOffs.sys.mjs | 6 +- .../components/urlbar/UrlbarSearchUtils.sys.mjs | 8 +- browser/components/urlbar/UrlbarUtils.sys.mjs | 116 +- browser/components/urlbar/UrlbarView.sys.mjs | 115 +- .../urlbar/content/enUS-searchFeatures.ftl | 5 + .../urlbar/content/quicksuggestOnboarding.css | 2 +- browser/components/urlbar/docs/overview.rst | 18 +- browser/components/urlbar/docs/ranking.rst | 2 +- browser/components/urlbar/docs/telemetry.rst | 13 +- browser/components/urlbar/docs/testing.rst | 16 +- browser/components/urlbar/docs/utilities.rst | 8 +- browser/components/urlbar/metrics.yaml | 152 +- .../urlbar/private/AddonSuggestions.sys.mjs | 2 +- .../components/urlbar/private/AdmWikipedia.sys.mjs | 2 +- .../components/urlbar/private/BaseFeature.sys.mjs | 28 +- .../urlbar/private/MDNSuggestions.sys.mjs | 4 +- .../urlbar/private/SuggestBackendJs.sys.mjs | 1 - .../urlbar/private/SuggestBackendRust.sys.mjs | 43 +- browser/components/urlbar/private/Weather.sys.mjs | 151 +- .../urlbar/private/YelpSuggestions.sys.mjs | 4 +- .../urlbar/tests/UrlbarTestUtils.sys.mjs | 7 +- .../browser-tips/browser_searchTips_interaction.js | 2 +- .../browser_appendSpanCount.js | 2 +- .../urlbar/tests/browser-updateResults/head.js | 2 +- .../components/urlbar/tests/browser/browser.toml | 3 +- .../browser_acknowledgeFeedbackAndDismissal.js | 162 +- .../tests/browser/browser_add_search_engine.js | 5 +- .../urlbar/tests/browser/browser_autoOpen.js | 2 +- .../urlbar/tests/browser/browser_bestMatch.js | 6 +- .../urlbar/tests/browser/browser_blanking.js | 2 +- .../urlbar/tests/browser/browser_clipboard.js | 43 +- .../tests/browser/browser_copy_during_load.js | 2 +- .../urlbar/tests/browser/browser_copying.js | 2 +- .../urlbar/tests/browser/browser_dragdropURL.js | 4 +- .../urlbar/tests/browser/browser_dynamicResults.js | 6 +- .../urlbar/tests/browser/browser_groupLabels.js | 4 +- .../tests/browser/browser_locationBarCommand.js | 2 +- .../browser/browser_locationBarExternalLoad.js | 4 +- .../browser_locationchange_urlbar_edit_dos.js | 2 +- .../browser/browser_oneOffs_heuristicRestyle.js | 2 +- .../tests/browser/browser_oneOffs_settings.js | 2 +- .../urlbar/tests/browser/browser_recentsearches.js | 94 +- .../urlbar/tests/browser/browser_redirect_error.js | 2 +- .../urlbar/tests/browser/browser_remove_match.js | 2 +- .../tests/browser/browser_result_onSelection.js | 2 +- .../browser/browser_results_format_displayValue.js | 2 +- .../browser/browser_retainedResultsOnFocus.js | 2 +- .../urlbar/tests/browser/browser_revert.js | 2 +- .../tests/browser/browser_searchMode_indicator.js | 4 +- .../browser_searchMode_indicator_clickthrough.js | 4 +- .../browser_searchMode_localOneOffs_actionText.js | 2 +- .../browser/browser_searchMode_suggestions.js | 20 +- .../browser_searchSingleWordNotification.js | 10 +- .../tests/browser/browser_search_continuation.js | 64 +- .../tests/browser/browser_selectStaleResults.js | 2 +- .../browser/browser_shortcuts_add_search_engine.js | 2 +- ...ser_speculative_connect_not_with_client_cert.js | 2 +- .../urlbar/tests/browser/browser_stop.js | 2 +- .../urlbar/tests/browser/browser_strip_on_share.js | 4 +- .../browser/browser_strip_on_share_telemetry.js | 2 +- .../browser/browser_switchTab_inputHistory.js | 69 +- .../tests/browser/browser_switchTab_override.js | 2 +- .../browser/browser_tabMatchesInAwesomebar.js | 2 +- .../urlbar/tests/browser/browser_tabToSearch.js | 6 +- .../tests/browser/browser_top_sites_switchtab.js | 209 + .../browser/browser_urlbar_telemetry_dynamic.js | 2 +- .../tests/browser/browser_urlbar_telemetry_tip.js | 4 +- .../tests/browser/browser_valueOnTabSwitch.js | 2 +- .../browser/browser_view_removedSelectedElement.js | 2 +- .../tests/browser/browser_view_selectionByMouse.js | 7 +- browser/components/urlbar/tests/browser/head.js | 2 +- .../tests/engagementTelemetry/browser/browser.toml | 22 +- .../browser_glean_telemetry_abandonment_tips.js | 2 +- .../browser_glean_telemetry_abandonment_type.js | 109 + ...rowser_glean_telemetry_engagement_edge_cases.js | 8 +- .../browser_glean_telemetry_engagement_groups.js | 8 +- ...owser_glean_telemetry_engagement_interaction.js | 8 +- ...r_glean_telemetry_engagement_selected_result.js | 269 +- .../browser_glean_telemetry_engagement_tips.js | 4 +- .../browser_glean_telemetry_engagement_type.js | 16 +- .../browser_glean_telemetry_exposure_edge_cases.js | 626 +- .../browser_glean_telemetry_impression_groups.js | 258 - ...owser_glean_telemetry_impression_interaction.js | 68 - ..._interaction_persisted_search_terms_disabled.js | 57 - ...n_interaction_persisted_search_terms_enabled.js | 61 - ...r_glean_telemetry_impression_n_chars_n_words.js | 40 - ...owser_glean_telemetry_impression_preferences.js | 41 - .../browser_glean_telemetry_impression_sap.js | 38 - ...elemetry_impression_search_engine_default_id.js | 28 - ...owser_glean_telemetry_impression_search_mode.js | 72 - .../browser_glean_telemetry_impression_timing.js | 91 - .../engagementTelemetry/browser/head-groups.js | 32 +- .../browser/head-interaction.js | 23 +- .../browser/head-n_chars_n_words.js | 8 +- .../tests/engagementTelemetry/browser/head-sap.js | 5 +- .../browser/head-search_engine_default_id.js | 4 +- .../browser/head-search_mode.js | 12 +- .../tests/engagementTelemetry/browser/head.js | 28 +- .../tests/quicksuggest/MerinoTestUtils.sys.mjs | 18 +- .../quicksuggest/RemoteSettingsServer.sys.mjs | 30 +- .../browser_quicksuggest_onboardingDialog.js | 3 - .../browser_telemetry_impressionEdgeCases.js | 2 +- .../tests/quicksuggest/browser/browser_weather.js | 107 +- .../urlbar/tests/quicksuggest/browser/head.js | 82 +- .../urlbar/tests/quicksuggest/unit/head.js | 113 +- .../tests/quicksuggest/unit/test_quicksuggest.js | 58 +- .../quicksuggest/unit/test_quicksuggest_addons.js | 12 +- .../quicksuggest/unit/test_quicksuggest_pocket.js | 4 +- .../tests/quicksuggest/unit/test_rust_ingest.js | 33 +- .../urlbar/tests/quicksuggest/unit/test_weather.js | 200 +- .../quicksuggest/unit/test_weather_keywords.js | 139 +- .../urlbar/tests/quicksuggest/unit/xpcshell.toml | 1 + browser/components/urlbar/tests/unit/head.js | 33 +- .../urlbar/tests/unit/test_UrlbarPrefs.js | 8 +- .../urlbar/tests/unit/test_UrlbarSearchUtils.js | 24 +- .../urlbar/tests/unit/test_about_urls.js | 6 + .../tests/unit/test_autofill_originsAndQueries.js | 12 +- .../urlbar/tests/unit/test_heuristic_cancel.js | 2 +- .../urlbar/tests/unit/test_hideSponsoredHistory.js | 2 +- .../urlbar/tests/unit/test_match_javascript.js | 5 +- .../tests/unit/test_providerHistoryUrlHeuristic.js | 2 + .../urlbar/tests/unit/test_providerOpenTabs.js | 99 +- .../urlbar/tests/unit/test_providerTabToSearch.js | 4 +- .../tests/unit/test_providersManager_filtering.js | 6 +- .../urlbar/tests/unit/test_remote_tabs.js | 4 +- .../urlbar/tests/unit/test_search_suggestions.js | 4 +- browser/components/urlbar/tests/unit/xpcshell.toml | 4 - .../config/mozconfigs/linux64/asan-fuzzing-ccov | 33 +- browser/config/mozconfigs/win32/common-win32 | 2 +- browser/config/mozconfigs/win32/mingwclang | 2 +- .../config/mozconfigs/win64-aarch64/common-win64 | 2 +- browser/config/mozconfigs/win64/common-win64 | 2 +- browser/config/mozconfigs/win64/mingwclang | 2 +- browser/config/mozconfigs/win64/plain-opt | 2 +- browser/config/version.txt | 2 +- browser/config/version_display.txt | 2 +- browser/docs/BrowserUsageTelemetry.rst | 2 +- browser/docs/index.rst | 1 + browser/extensions/formautofill/api.js | 2 +- browser/extensions/formautofill/background.js | 2 +- .../formautofill/content/autofillEditForms.js | 8 +- .../formautofill/content/customElements.js | 11 +- .../extensions/formautofill/content/editDialog.js | 6 +- .../formautofill/content/manageCreditCards.xhtml | 1 + .../formautofill/content/manageDialog.js | 7 +- .../locales/en-US/formautofill.properties | 6 - .../formautofill/test/browser/address/browser.toml | 2 + .../browser_address_capture_form_removal.js | 2 +- .../browser_address_capture_trimmed_data.js | 100 + .../browser_address_doorhanger_not_shown.js | 2 +- .../address/browser_address_doorhanger_state.js | 103 +- ...rowser_address_doorhanger_unsupported_region.js | 4 +- .../browser/address/browser_address_telemetry.js | 2 +- .../formautofill/test/browser/browser.toml | 3 + .../browser/browser_active_window_navigation.js | 6 +- .../test/browser/browser_autocomplete_footer.js | 47 +- .../browser/browser_autofill_sandboxed_iframe.js | 31 + .../test/browser/creditCard/browser.toml | 78 +- .../browser_creditCard_capture_form_removal.js | 2 +- ...rowser_creditCard_capture_multiple_cc_number.js | 102 + .../browser_creditCard_doorhanger_not_shown.js | 2 +- .../extensions/formautofill/test/browser/head.js | 14 +- .../test/browser/heuristics/browser.toml | 4 +- .../browser_ignore_unfocusable_fields.js | 159 - .../browser_sections_with_invisible_fields.js | 131 + .../heuristics/third_party/browser_Euronics.js | 2 + .../heuristics/third_party/browser_HomeDepot.js | 11 +- .../fixtures/autocomplete_iframe_sandboxed.html | 11 + .../test/mochitest/creditCard/test_clear_form.html | 1 - .../test_clear_form_expiry_select_elements.html | 1 - ...w_highlight_with_multiple_cc_number_fields.html | 2 - .../test/mochitest/formautofill_common.js | 22 - .../test/mochitest/formautofill_parent_utils.js | 34 +- .../mochitest/test_autofill_and_ordinal_forms.html | 6 +- .../test/mochitest/test_form_changes.html | 3 +- browser/extensions/formautofill/test/unit/head.js | 18 - .../test/unit/test_autofillFormFields.js | 35 +- .../test/unit/test_getFormInputDetails.js | 18 +- .../test/unit/test_markAsAutofillField.js | 32 +- .../formautofill/test/unit/test_onFormSubmitted.js | 712 - .../formautofill/test/unit/test_phoneNumber.js | 4 +- .../test/unit/test_previewFormFields.js | 2 +- .../test/unit/test_storage_tombstones.js | 8 +- .../formautofill/test/unit/xpcshell.toml | 6 +- .../experiment-apis/pictureInPicture.js | 3 +- .../pictureinpicture/video-wrappers/airmozilla.js | 2 +- .../pictureinpicture/video-wrappers/arte.js | 2 +- .../pictureinpicture/video-wrappers/bbc.js | 2 +- .../pictureinpicture/video-wrappers/dailymotion.js | 2 +- .../pictureinpicture/video-wrappers/disneyplus.js | 2 +- .../pictureinpicture/video-wrappers/edx.js | 2 +- .../pictureinpicture/video-wrappers/hbomax.js | 2 +- .../pictureinpicture/video-wrappers/hotstar.js | 2 +- .../pictureinpicture/video-wrappers/hulu.js | 4 +- .../video-wrappers/mock-wrapper.js | 4 +- .../pictureinpicture/video-wrappers/netflix.js | 8 +- .../pictureinpicture/video-wrappers/nytimes.js | 2 +- .../pictureinpicture/video-wrappers/piped.js | 2 +- .../pictureinpicture/video-wrappers/primeVideo.js | 2 +- .../pictureinpicture/video-wrappers/sonyliv.js | 2 +- .../pictureinpicture/video-wrappers/tubi.js | 2 +- .../pictureinpicture/video-wrappers/tubilive.js | 2 +- .../pictureinpicture/video-wrappers/twitch.js | 2 +- .../pictureinpicture/video-wrappers/udemy.js | 2 +- .../video-wrappers/videojsWrapper.js | 2 +- .../pictureinpicture/video-wrappers/voot.js | 2 +- .../video-wrappers/washingtonpost.js | 2 +- .../pictureinpicture/video-wrappers/yahoo.js | 2 +- .../pictureinpicture/video-wrappers/youtube.js | 4 +- browser/extensions/report-site-issue/.eslintrc.js | 3 - browser/extensions/report-site-issue/background.js | 43 +- browser/extensions/report-site-issue/manifest.json | 4 +- .../report-site-issue/test/browser/head.js | 2 - .../report-site-issue/test/browser/test.html | 1 - .../screenshots/test/browser/browser.toml | 6 +- .../extensions/search-detection/extension/api.js | 4 +- browser/extensions/webcompat/data/injections.js | 95 +- browser/extensions/webcompat/data/shims.js | 11 - browser/extensions/webcompat/data/ua_overrides.js | 124 +- .../bug1654877-preev.com-moz-appearance-fix.css | 19 - .../css/bug1848716-elal.com-unsupported-banner.css | 16 - .../bug1877346-offerup.com-infinite-scroll-fix.css | 20 + .../css/bug1884842-foodora.cz-height-fix.css | 25 + .../bug1631811-datastudio.google.com-indexedDB.js | 22 - ...-relearnings.com-linkedinlearning-iframe-fix.js | 33 - browser/extensions/webcompat/manifest.json | 3 +- browser/extensions/webcompat/moz.build | 7 +- .../shims/private-browsing-web-api-fixes.js | 19 - browser/installer/package-manifest.in | 13 +- browser/installer/windows/docs/InstallerBuild.rst | 4 +- browser/installer/windows/docs/MSIX.rst | 21 + browser/installer/windows/msix/AppxManifest.xml.in | 8 +- browser/installer/windows/nsis/installer.nsi | 19 +- browser/installer/windows/nsis/shared.nsh | 47 + browser/installer/windows/nsis/uninstaller.nsi | 57 +- browser/locales-preview/select-translations.ftl | 21 + .../locales/en-US/browser/confirmationHints.ftl | 1 - browser/locales/en-US/browser/firefoxView.ftl | 28 + browser/locales/en-US/browser/fxviewTabList.ftl | 26 +- browser/locales/en-US/browser/newtab/newtab.ftl | 1 + .../browser/policies/policies-descriptions.ftl | 6 + .../en-US/browser/preferences/connection.ftl | 3 + .../en-US/browser/preferences/formAutofill.ftl | 12 - .../en-US/browser/preferences/preferences.ftl | 5 +- browser/locales/en-US/browser/protectionsPanel.ftl | 44 - .../locales/en-US/browser/webProtocolHandler.ftl | 2 + .../chrome/browser/downloads/downloads.properties | 4 +- browser/locales/jar.mn | 1 + browser/locales/l10n-changesets.json | 204 +- browser/modules/BrowserUsageTelemetry.sys.mjs | 8 +- browser/modules/BrowserWindowTracker.sys.mjs | 4 - .../modules/FirefoxBridgeExtensionUtils.sys.mjs | 360 + browser/modules/PageActions.sys.mjs | 2 +- browser/modules/PermissionUI.sys.mjs | 4 +- browser/modules/Sanitizer.sys.mjs | 40 +- browser/modules/moz.build | 7 + .../test/unit/test_FirefoxBridgeExtensionUtils.js | 350 + ...st_FirefoxBridgeExtensionUtilsNativeManifest.js | 222 + browser/modules/test/unit/xpcshell.toml | 9 + browser/themes/linux/browser.css | 115 +- browser/themes/shared/browser-shared.css | 14 - browser/themes/shared/controlcenter/panel.css | 88 +- .../shared/customizableui/panelUI-shared.css | 91 +- .../themes/shared/formautofill-notification.css | 5 +- .../themes/shared/icons/circle-check-dotted.svg | 4 + browser/themes/shared/icons/pin-12.svg | 5 +- browser/themes/shared/jar.inc.mn | 1 + .../themes/shared/migration/migration-wizard.css | 30 +- browser/themes/shared/places/editBookmarkPanel.css | 11 - browser/themes/shared/preferences/preferences.css | 28 +- browser/themes/shared/toolbarbutton-icons.css | 4 + browser/themes/shared/toolbarbuttons.css | 1 + browser/themes/shared/translations/panel.css | 66 +- browser/themes/shared/urlbar-dynamic-results.css | 7 +- browser/themes/shared/urlbarView.css | 66 +- browser/themes/triage.json | 86 + browser/themes/windows/browser.css | 5 - 1068 files changed, 47706 insertions(+), 61164 deletions(-) create mode 100644 browser/app/nmhproxy/Cargo.toml create mode 100644 browser/app/nmhproxy/moz.build create mode 100644 browser/app/nmhproxy/src/commands.rs create mode 100644 browser/app/nmhproxy/src/main.rs create mode 100644 browser/base/content/browser-profiles.js create mode 100644 browser/base/content/browser.js.globals create mode 100644 browser/base/content/test/forms/browser_selectpopup_minFontSize.js delete mode 100644 browser/base/content/test/protectionsUI/browser_protectionsUI_report_breakage.js create mode 100644 browser/base/content/test/sanitize/browser_sanitizeDialog_v2_dataSizes.js create mode 100644 browser/base/content/test/siteIdentity/browser_identity_web_controlled_blank.js create mode 100644 browser/base/content/test/siteIdentity/test_web_controlled_blank.html create mode 100644 browser/base/triage-tabbrowser.json create mode 100644 browser/components/aboutwelcome/modules/AWToolbarUtils.sys.mjs create mode 100644 browser/components/aboutwelcome/tests/browser/browser_aboutwelcome_multistage_transitions.js create mode 100644 browser/components/aboutwelcome/tests/browser/browser_aboutwelcome_toolbar_button.js create mode 100644 browser/components/aboutwelcome/tests/xpcshell/test_AboutWelcomeAttribution.js create mode 100644 browser/components/aboutwelcome/tests/xpcshell/test_AboutWelcomeTelemetry.js create mode 100644 browser/components/aboutwelcome/tests/xpcshell/test_AboutWelcomeTelemetry_glean.js create mode 100644 browser/components/aboutwelcome/tests/xpcshell/xpcshell.toml delete mode 100644 browser/components/asrouter/README.md delete mode 100644 browser/components/asrouter/content-src/asrouter-utils.js create mode 100644 browser/components/asrouter/content-src/asrouter-utils.mjs delete mode 100644 browser/components/asrouter/content-src/components/ConditionalWrapper/ConditionalWrapper.jsx delete mode 100644 browser/components/asrouter/content-src/components/ImpressionsWrapper/ImpressionsWrapper.jsx delete mode 100644 browser/components/asrouter/content-src/schemas/message-format.md delete mode 100644 browser/components/asrouter/tests/unit/ModalOverlay.test.jsx create mode 100644 browser/components/backup/.eslintrc.js create mode 100644 browser/components/backup/BackupResources.sys.mjs create mode 100644 browser/components/backup/BackupService.sys.mjs create mode 100644 browser/components/backup/docs/backup-service.rst create mode 100644 browser/components/backup/docs/index.rst create mode 100644 browser/components/backup/metrics.yaml create mode 100644 browser/components/backup/moz.build create mode 100644 browser/components/backup/resources/BackupResource.sys.mjs create mode 100644 browser/components/backup/tests/xpcshell/data/test_xulstore.json create mode 100644 browser/components/backup/tests/xpcshell/test_BrowserResource.js create mode 100644 browser/components/backup/tests/xpcshell/test_measurements.js create mode 100644 browser/components/backup/tests/xpcshell/xpcshell.toml create mode 100644 browser/components/extensions/test/browser/search-engines/search-config-v2.json delete mode 100644 browser/components/firefoxview/content/category-history.svg delete mode 100644 browser/components/firefoxview/content/category-opentabs.svg delete mode 100644 browser/components/firefoxview/content/category-recentbrowsing.svg delete mode 100644 browser/components/firefoxview/content/category-recentlyclosed.svg delete mode 100644 browser/components/firefoxview/content/category-syncedtabs.svg create mode 100644 browser/components/firefoxview/content/view-history.svg create mode 100644 browser/components/firefoxview/content/view-opentabs.svg create mode 100644 browser/components/firefoxview/content/view-recentbrowsing.svg create mode 100644 browser/components/firefoxview/content/view-recentlyclosed.svg create mode 100644 browser/components/firefoxview/content/view-syncedtabs.svg delete mode 100644 browser/components/firefoxview/fxview-category-button.css delete mode 100644 browser/components/firefoxview/fxview-category-navigation.css delete mode 100644 browser/components/firefoxview/fxview-category-navigation.mjs create mode 100644 browser/components/firefoxview/tests/browser/browser_opentabs_more.js create mode 100644 browser/components/firefoxview/tests/browser/browser_opentabs_pinned_tabs.js create mode 100644 browser/components/firefoxview/tests/browser/browser_opentabs_search.js create mode 100644 browser/components/firefoxview/tests/browser/browser_tab_list_keyboard_navigation.js delete mode 100644 browser/components/firefoxview/tests/chrome/test_fxview_category_navigation.html create mode 100644 browser/components/newtab/content-src/components/DiscoveryStreamComponents/FeatureHighlight/FeatureHighlight.jsx create mode 100644 browser/components/newtab/content-src/components/DiscoveryStreamComponents/FeatureHighlight/SponsoredContentHighlight.jsx create mode 100644 browser/components/newtab/content-src/components/DiscoveryStreamComponents/FeatureHighlight/_FeatureHighlight.scss create mode 100644 browser/components/newtab/content-src/components/DiscoveryStreamComponents/FeatureHighlight/_SponsoredContentHighlight.scss create mode 100644 browser/components/newtab/data/content/assets/sponsor-message-icon.svg delete mode 100644 browser/components/newtab/loaders/inject-loader.js create mode 100644 browser/components/newtab/test/unit/content-src/components/DiscoveryStreamComponents/FeatureHighlight.test.jsx create mode 100644 browser/components/newtab/test/unit/content-src/components/ModalOverlay.test.jsx delete mode 100644 browser/components/newtab/test/xpcshell/test_AboutWelcomeAttribution.js delete mode 100644 browser/components/newtab/test/xpcshell/test_AboutWelcomeTelemetry.js delete mode 100644 browser/components/newtab/test/xpcshell/test_AboutWelcomeTelemetry_glean.js delete mode 100644 browser/components/places/tests/browser/browser_bookmark_all_tabs.js create mode 100644 browser/components/places/tests/browser/browser_bookmark_current_tabs.js create mode 100644 browser/components/preferences/tests/browser_about_settings.js create mode 100644 browser/components/preferences/tests/browser_dns_over_https_exceptions_subdialog.js create mode 100644 browser/components/profiles/ProfilesChild.sys.mjs create mode 100644 browser/components/profiles/ProfilesParent.sys.mjs create mode 100644 browser/components/profiles/content/profiles.ftl create mode 100644 browser/components/profiles/content/profiles.html create mode 100644 browser/components/profiles/jar.mn create mode 100644 browser/components/profiles/moz.build delete mode 100644 browser/components/reportbrokensite/test/browser/browser_site_not_working_fallback.js create mode 100644 browser/components/screenshots/tests/browser/browser_test_moving_tab_to_new_window.js create mode 100644 browser/components/search/DomainToCategoriesMap.worker.mjs create mode 100644 browser/components/search/test/browser/telemetry/browser_search_telemetry_adImpression_component_skipCount_children.js create mode 100644 browser/components/search/test/browser/telemetry/browser_search_telemetry_adImpression_component_skipCount_parent.js create mode 100644 browser/components/search/test/browser/telemetry/browser_search_telemetry_engagement_eventListeners_children.js create mode 100644 browser/components/search/test/browser/telemetry/browser_search_telemetry_engagement_eventListeners_parent.js create mode 100644 browser/components/search/test/browser/telemetry/browser_search_telemetry_engagement_ignoreLinkRegexps.js create mode 100644 browser/components/search/test/browser/telemetry/browser_search_telemetry_engagement_nonAdsLinkQueryParamNames.js delete mode 100644 browser/components/search/test/browser/telemetry/domain_category_mappings.json create mode 100644 browser/components/search/test/browser/telemetry/searchTelemetryAd_components_cookie_banner.html create mode 100644 browser/components/search/test/browser/telemetry/searchTelemetryAd_searchbox_with_redirecting_links.html create mode 100644 browser/components/search/test/browser/telemetry/searchTelemetry_redirect_with_js.html delete mode 100644 browser/components/search/test/unit/domain_category_mappings_1a.json delete mode 100644 browser/components/search/test/unit/domain_category_mappings_1b.json delete mode 100644 browser/components/search/test/unit/domain_category_mappings_2a.json delete mode 100644 browser/components/search/test/unit/domain_category_mappings_2b.json delete mode 100644 browser/components/search/test/unit/test_search_telemetry_categorization_process_domains.js create mode 100644 browser/components/sidebar/jar.mn create mode 100644 browser/components/sidebar/moz.build create mode 100644 browser/components/storybook/.babelrc.json create mode 100644 browser/components/storybook/.storybook/addon-component-status/StatusIndicator.jsx delete mode 100644 browser/components/storybook/.storybook/addon-component-status/StatusIndicator.mjs create mode 100644 browser/components/storybook/.storybook/addon-fluent/FluentPanel.jsx delete mode 100644 browser/components/storybook/.storybook/addon-fluent/FluentPanel.mjs create mode 100644 browser/components/storybook/.storybook/addon-fluent/PseudoLocalizationButton.jsx delete mode 100644 browser/components/storybook/.storybook/addon-fluent/PseudoLocalizationButton.mjs create mode 100644 browser/components/storybook/.storybook/markdown-story-indexer.js create mode 100644 browser/components/storybook/.storybook/markdown-story-utils.js delete mode 100644 browser/components/storybook/stories/fxview-category-navigation.stories.mjs create mode 100644 browser/components/tests/browser/browser_default_webprotocol_handler_mailto.js delete mode 100644 browser/components/tests/browser/browser_system_notification_telemetry.js create mode 100644 browser/components/tests/browser/whats_new_page/browser_whats_new_page_nimbus.js create mode 100644 browser/components/tests/browser/whats_new_page/browser_whats_new_page_nimbus.toml create mode 100644 browser/components/translations/content/TranslationsPanelShared.sys.mjs create mode 100644 browser/components/translations/content/fullPageTranslationsPanel.inc.xhtml create mode 100644 browser/components/translations/content/fullPageTranslationsPanel.js create mode 100644 browser/components/translations/content/selectTranslationsPanel.inc.xhtml create mode 100644 browser/components/translations/content/selectTranslationsPanel.js delete mode 100644 browser/components/translations/content/translationsPanel.inc.xhtml delete mode 100644 browser/components/translations/content/translationsPanel.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_a11y_focus.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_always_translate_language_bad_data.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_always_translate_language_basic.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_always_translate_language_manual.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_always_translate_language_restore.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_app_menu_never_translate_language.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_app_menu_never_translate_site.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_auto_translate_error_view.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_auto_translate_revisit_view.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_basics.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_button.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_cancel.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_close_panel_never_translate_language_with_translations_active.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_close_panel_never_translate_language_with_translations_inactive.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_close_panel_never_translate_site.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_engine_destroy.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_engine_destroy_pending.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_engine_unsupported.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_engine_unsupported_lang.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_firstrun.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_firstrun_revisit.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_fuzzing.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_gear.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_never_translate_language.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_never_translate_site.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_never_translate_site_auto.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_never_translate_site_basic.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_never_translate_site_manual.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_retry.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_settings_unsupported_lang.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_panel_switch_languages.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_reader_mode.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_telemetry_firstrun_auto_translate.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_telemetry_firstrun_basics.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_telemetry_firstrun_translation_failure.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_telemetry_firstrun_unsupported_lang.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_telemetry_open_panel.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_telemetry_panel_auto_offer.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_telemetry_panel_auto_offer_settings.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_telemetry_switch_languages.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_telemetry_translation_failure.js create mode 100644 browser/components/translations/tests/browser/browser_translations_full_page_telemetry_translation_request.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_a11y_focus.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_always_translate_language_bad_data.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_always_translate_language_basic.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_always_translate_language_manual.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_always_translate_language_restore.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_app_menu_never_translate_language.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_app_menu_never_translate_site.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_auto_translate_error_view.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_auto_translate_revisit_view.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_basics.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_button.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_cancel.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_close_panel_never_translate_language_with_translations_active.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_close_panel_never_translate_language_with_translations_inactive.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_close_panel_never_translate_site.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_engine_destroy.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_engine_destroy_pending.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_engine_unsupported.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_engine_unsupported_lang.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_firstrun.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_firstrun_revisit.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_fuzzing.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_gear.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_never_translate_language.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_never_translate_site.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_never_translate_site_auto.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_never_translate_site_basic.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_never_translate_site_manual.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_retry.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_settings_unsupported_lang.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_panel_switch_languages.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_reader_mode.js create mode 100644 browser/components/translations/tests/browser/browser_translations_select_panel_language_selectors.js create mode 100644 browser/components/translations/tests/browser/browser_translations_select_panel_mainview_ui.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_telemetry_firstrun_auto_translate.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_telemetry_firstrun_basics.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_telemetry_firstrun_translation_failure.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_telemetry_firstrun_unsupported_lang.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_telemetry_open_panel.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_telemetry_panel_auto_offer.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_telemetry_panel_auto_offer_settings.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_telemetry_switch_languages.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_telemetry_translation_failure.js delete mode 100644 browser/components/translations/tests/browser/browser_translations_telemetry_translation_request.js create mode 100644 browser/components/urlbar/tests/browser/browser_top_sites_switchtab.js create mode 100644 browser/components/urlbar/tests/engagementTelemetry/browser/browser_glean_telemetry_abandonment_type.js delete mode 100644 browser/components/urlbar/tests/engagementTelemetry/browser/browser_glean_telemetry_impression_groups.js delete mode 100644 browser/components/urlbar/tests/engagementTelemetry/browser/browser_glean_telemetry_impression_interaction.js delete mode 100644 browser/components/urlbar/tests/engagementTelemetry/browser/browser_glean_telemetry_impression_interaction_persisted_search_terms_disabled.js delete mode 100644 browser/components/urlbar/tests/engagementTelemetry/browser/browser_glean_telemetry_impression_interaction_persisted_search_terms_enabled.js delete mode 100644 browser/components/urlbar/tests/engagementTelemetry/browser/browser_glean_telemetry_impression_n_chars_n_words.js delete mode 100644 browser/components/urlbar/tests/engagementTelemetry/browser/browser_glean_telemetry_impression_preferences.js delete mode 100644 browser/components/urlbar/tests/engagementTelemetry/browser/browser_glean_telemetry_impression_sap.js delete mode 100644 browser/components/urlbar/tests/engagementTelemetry/browser/browser_glean_telemetry_impression_search_engine_default_id.js delete mode 100644 browser/components/urlbar/tests/engagementTelemetry/browser/browser_glean_telemetry_impression_search_mode.js delete mode 100644 browser/components/urlbar/tests/engagementTelemetry/browser/browser_glean_telemetry_impression_timing.js create mode 100644 browser/extensions/formautofill/test/browser/address/browser_address_capture_trimmed_data.js create mode 100644 browser/extensions/formautofill/test/browser/browser_autofill_sandboxed_iframe.js create mode 100644 browser/extensions/formautofill/test/browser/creditCard/browser_creditCard_capture_multiple_cc_number.js delete mode 100644 browser/extensions/formautofill/test/browser/heuristics/browser_ignore_unfocusable_fields.js create mode 100644 browser/extensions/formautofill/test/browser/heuristics/browser_sections_with_invisible_fields.js create mode 100644 browser/extensions/formautofill/test/fixtures/autocomplete_iframe_sandboxed.html delete mode 100644 browser/extensions/formautofill/test/unit/test_onFormSubmitted.js delete mode 100644 browser/extensions/webcompat/injections/css/bug1654877-preev.com-moz-appearance-fix.css delete mode 100644 browser/extensions/webcompat/injections/css/bug1848716-elal.com-unsupported-banner.css create mode 100644 browser/extensions/webcompat/injections/css/bug1877346-offerup.com-infinite-scroll-fix.css create mode 100644 browser/extensions/webcompat/injections/css/bug1884842-foodora.cz-height-fix.css delete mode 100644 browser/extensions/webcompat/injections/js/bug1631811-datastudio.google.com-indexedDB.js delete mode 100644 browser/extensions/webcompat/injections/js/bug1790750-relearnings.com-linkedinlearning-iframe-fix.js delete mode 100644 browser/extensions/webcompat/shims/private-browsing-web-api-fixes.js create mode 100644 browser/modules/FirefoxBridgeExtensionUtils.sys.mjs create mode 100644 browser/modules/test/unit/test_FirefoxBridgeExtensionUtils.js create mode 100644 browser/modules/test/unit/test_FirefoxBridgeExtensionUtilsNativeManifest.js create mode 100644 browser/themes/shared/icons/circle-check-dotted.svg create mode 100644 browser/themes/triage.json (limited to 'browser') diff --git a/browser/actors/ContentSearchParent.sys.mjs b/browser/actors/ContentSearchParent.sys.mjs index 7c1a39536c..73b881881b 100644 --- a/browser/actors/ContentSearchParent.sys.mjs +++ b/browser/actors/ContentSearchParent.sys.mjs @@ -553,22 +553,34 @@ export let ContentSearch = { }, /** - * Converts the engine's icon into an appropriate URL for display at + * Converts the engine's icon into a URL or an ArrayBuffer for passing to the + * content process. + * + * @param {nsISearchEngine} engine + * The engine to get the icon for. + * @returns {string|ArrayBuffer} + * The icon's URL or an ArrayBuffer containing the icon data. */ async _getEngineIconURL(engine) { - let url = engine.getIconURL(); + let url = await engine.getIconURL(); if (!url) { return SEARCH_ENGINE_PLACEHOLDER_ICON; } - // The uri received here can be of two types + // The uri received here can be one of several types: // 1 - moz-extension://[uuid]/path/to/icon.ico // 2 - data:image/x-icon;base64,VERY-LONG-STRING + // 3 - blob: // - // If the URI is not a data: URI, there's no point in converting - // it to an arraybuffer (which is used to optimize passing the data - // accross processes): we can just pass the original URI, which is cheaper. - if (!url.startsWith("data:")) { + // For moz-extension URIs we can pass the URI to the content process and + // use it directly as they can be accessed from there and it is cheaper. + // + // For blob URIs the content process is a different scope and we can't share + // the blob with that scope. Hence we have to create a copy of the data. + // + // For data: URIs we convert to an ArrayBuffer as that is more optimal for + // passing the data across to the content process. + if (!url.startsWith("data:") && !url.startsWith("blob:")) { return url; } diff --git a/browser/actors/ContextMenuChild.sys.mjs b/browser/actors/ContextMenuChild.sys.mjs index 34e39101c2..e16efdc9cd 100644 --- a/browser/actors/ContextMenuChild.sys.mjs +++ b/browser/actors/ContextMenuChild.sys.mjs @@ -471,17 +471,6 @@ export class ContextMenuChild extends JSWindowActorChild { return this.contentWindow.HTMLTextAreaElement.isInstance(node); } - /** - * Check if we are in the parent process and the current iframe is the RDM iframe. - */ - _isTargetRDMFrame(node) { - return ( - Services.appinfo.processType === Services.appinfo.PROCESS_TYPE_DEFAULT && - node.tagName === "iframe" && - node.hasAttribute("mozbrowser") - ); - } - _isSpellCheckEnabled(aNode) { // We can always force-enable spellchecking on textboxes if (this._isTargetATextBox(aNode)) { @@ -545,12 +534,6 @@ export class ContextMenuChild extends JSWindowActorChild { return; } - if (this._isTargetRDMFrame(aEvent.composedTarget)) { - // The target is in the DevTools RDM iframe, a proper context menu event - // will be created from the RDM browser. - return; - } - let doc = aEvent.composedTarget.ownerDocument; let { mozDocumentURIIfNotForErrorPages: docLocation, diff --git a/browser/actors/FormValidationChild.sys.mjs b/browser/actors/FormValidationChild.sys.mjs index 6fa2e3c90d..f5ce427d03 100644 --- a/browser/actors/FormValidationChild.sys.mjs +++ b/browser/actors/FormValidationChild.sys.mjs @@ -73,7 +73,11 @@ export class FormValidationChild extends JSWindowActorChild { if (element.isFormAssociatedCustomElements) { // For element that are form-associated custom elements, user agents // should use their validation anchor instead. - element = element.internals.validationAnchor; + // It is not clear how constraint validation should work for FACE in + // spec if the validation anchor is null, see + // https://github.com/whatwg/html/issues/10155. Blink seems fallback to + // FACE itself when validation anchor is null, which looks reasonable. + element = element.internals.validationAnchor || element; } if (!element || !Services.focus.elementIsFocusable(element, 0)) { diff --git a/browser/actors/PromptParent.sys.mjs b/browser/actors/PromptParent.sys.mjs index 1407e06a75..4a159cbda5 100644 --- a/browser/actors/PromptParent.sys.mjs +++ b/browser/actors/PromptParent.sys.mjs @@ -140,8 +140,7 @@ export class PromptParent extends JSWindowActorParent { (args.modalType === Ci.nsIPrompt.MODAL_TYPE_CONTENT && !lazy.contentPromptSubDialog) || (args.modalType === Ci.nsIPrompt.MODAL_TYPE_TAB && - !lazy.tabChromePromptSubDialog) || - this.isAboutAddonsOptionsPage(this.browsingContext) + !lazy.tabChromePromptSubDialog) ) { return this.openContentPrompt(args, id); } @@ -262,6 +261,11 @@ export class PromptParent extends JSWindowActorParent { let browsingContext = this.browsingContext.top; let browser = browsingContext.embedderElement; + + if (this.isAboutAddonsOptionsPage(browsingContext)) { + browser = browser.ownerGlobal.browsingContext.embedderElement; + } + let promptRequiresBrowser = args.modalType === Services.prompt.MODAL_TYPE_TAB || args.modalType === Services.prompt.MODAL_TYPE_CONTENT; diff --git a/browser/actors/ScreenshotsComponentChild.sys.mjs b/browser/actors/ScreenshotsComponentChild.sys.mjs index 0a4d6d2539..06d7204803 100644 --- a/browser/actors/ScreenshotsComponentChild.sys.mjs +++ b/browser/actors/ScreenshotsComponentChild.sys.mjs @@ -44,11 +44,19 @@ export class ScreenshotsComponentChild extends JSWindowActorChild { return this.getDocumentTitle(); case "Screenshots:GetMethodsUsed": return this.getMethodsUsed(); + case "Screenshots:RemoveEventListeners": + return this.removeEventListeners(); + case "Screenshots:AddEventListeners": + return this.addEventListeners(); } return null; } handleEvent(event) { + if (!event.isTrusted) { + return; + } + switch (event.type) { case "click": case "pointerdown": @@ -80,14 +88,6 @@ export class ScreenshotsComponentChild extends JSWindowActorChild { } this.#scrollTask.arm(); break; - case "visibilitychange": - if ( - event.target.visibilityState === "hidden" && - this.overlay?.state === "crosshairs" - ) { - this.requestCancelScreenshot("navigation"); - } - break; case "Screenshots:Close": this.requestCancelScreenshot(event.detail.reason); break; @@ -97,14 +97,16 @@ export class ScreenshotsComponentChild extends JSWindowActorChild { case "Screenshots:Download": this.requestDownloadScreenshot(event.detail.region); break; - case "Screenshots:OverlaySelection": + case "Screenshots:OverlaySelection": { let { hasSelection } = event.detail; this.sendOverlaySelection({ hasSelection }); break; - case "Screenshots:RecordEvent": + } + case "Screenshots:RecordEvent": { let { eventName, reason, args } = event.detail; this.recordTelemetryEvent(eventName, reason, args); break; + } case "Screenshots:ShowPanel": this.showPanel(); break; @@ -206,6 +208,13 @@ export class ScreenshotsComponentChild extends JSWindowActorChild { }); } + addEventListeners() { + this.contentWindow.addEventListener("beforeunload", this); + this.contentWindow.addEventListener("resize", this); + this.contentWindow.addEventListener("scroll", this); + this.addOverlayEventListeners(); + } + addOverlayEventListeners() { let chromeEventHandler = this.docShell.chromeEventHandler; for (let event of ScreenshotsComponentChild.OVERLAY_EVENTS) { @@ -230,16 +239,19 @@ export class ScreenshotsComponentChild extends JSWindowActorChild { let overlay = this.overlay || (this.#overlay = new lazy.ScreenshotsOverlay(this.document)); - this.document.ownerGlobal.addEventListener("beforeunload", this); - this.contentWindow.addEventListener("resize", this); - this.contentWindow.addEventListener("scroll", this); - this.contentWindow.addEventListener("visibilitychange", this); - this.addOverlayEventListeners(); + this.addEventListeners(); overlay.initialize(); return true; } + removeEventListeners() { + this.contentWindow.removeEventListener("beforeunload", this); + this.contentWindow.removeEventListener("resize", this); + this.contentWindow.removeEventListener("scroll", this); + this.removeOverlayEventListeners(); + } + removeOverlayEventListeners() { let chromeEventHandler = this.docShell.chromeEventHandler; for (let event of ScreenshotsComponentChild.OVERLAY_EVENTS) { @@ -251,11 +263,7 @@ export class ScreenshotsComponentChild extends JSWindowActorChild { * Removes event listeners and the screenshots overlay. */ endScreenshotsOverlay(options = {}) { - this.document.ownerGlobal.removeEventListener("beforeunload", this); - this.contentWindow.removeEventListener("resize", this); - this.contentWindow.removeEventListener("scroll", this); - this.contentWindow.removeEventListener("visibilitychange", this); - this.removeOverlayEventListeners(); + this.removeEventListeners(); this.overlay?.tearDown(options); this.#resizeTask?.disarm(); diff --git a/browser/actors/SearchSERPTelemetryChild.sys.mjs b/browser/actors/SearchSERPTelemetryChild.sys.mjs index e6187e9e4b..c760f9a19e 100644 --- a/browser/actors/SearchSERPTelemetryChild.sys.mjs +++ b/browser/actors/SearchSERPTelemetryChild.sys.mjs @@ -25,6 +25,10 @@ XPCOMUtils.defineLazyPreferenceGetter( false ); +export const CATEGORIZATION_SETTINGS = { + MAX_DOMAINS_TO_CATEGORIZE: 10, +}; + // Duplicated from SearchSERPTelemetry to avoid loading the module on content // startup. const SEARCH_TELEMETRY_SHARED = { @@ -33,6 +37,22 @@ const SEARCH_TELEMETRY_SHARED = { SPA_LOAD_TIMEOUT: "SearchTelemetry:SPALoadTimeout", }; +/** + * Standard events mapped to the telemetry action. + */ +const EVENT_TYPE_TO_ACTION = { + click: "clicked", +}; + +/** + * A map of object conditions mapped to the condition that should be run when + * an event is triggered. The condition name is referenced in Remote Settings + * under the optional `condition` string for an event listener. + */ +const CONDITIONS = { + keydownEnter: event => event.key == "Enter", +}; + /** * SearchProviders looks after keeping track of the search provider information * received from the main process. @@ -50,7 +70,8 @@ class SearchProviders { * Gets the search provider information for any provider with advert information. * If there is nothing in the cache, it will obtain it from shared data. * - * @returns {object} Returns the search provider information. @see SearchTelemetry.jsm + * @returns {object} Returns the search provider information. + * @see SearchTelemetry.sys.mjs */ get info() { if (this._searchProviderInfo) { @@ -106,6 +127,129 @@ class SearchProviders { } } +/** + * @typedef {object} EventListenerParam + * @property {string} eventType + * The type of event the listener should listen for. If the event type is + * is non-standard, it should correspond to a definition in + * CUSTOM_EVENT_TYPE_TO_DATA that will re-map it to a standard type. TODO + * @property {string} target + * The type of component that was the source of the event. + * @property {string | null} action + * The action that should be reported in telemetry. + */ + +/** + * Provides a way to add listeners to elements, as well as unload them. + */ +class ListenerHelper { + /** + * Adds each event listener in an array of event listeners to each element + * in an array of elements, and sets their unloading. + * + * @param {Array} elements + * DOM elements to add event listeners to. + * @param {Array} eventListenerParams + * The type of event to add the listener to. + * @param {string} target + */ + static addListeners(elements, eventListenerParams, target) { + if (!elements?.length || !eventListenerParams?.length) { + return; + } + + let document = elements[0].ownerGlobal.document; + let callback = documentToEventCallbackMap.get(document); + if (!callback) { + return; + } + + // The map might have entries from previous callers, so we must ensure + // we don't discard existing event listener callbacks. + let removeListenerCallbacks = []; + if (documentToRemoveEventListenersMap.has(document)) { + removeListenerCallbacks = documentToRemoveEventListenersMap.get(document); + } + + for (let params of eventListenerParams) { + let removeListeners = ListenerHelper.addListener( + elements, + params, + target, + callback + ); + removeListenerCallbacks = removeListenerCallbacks.concat(removeListeners); + } + + documentToRemoveEventListenersMap.set(document, removeListenerCallbacks); + } + + /** + * Add an event listener to each element in an array of elements. + * + * @param {Array} elements + * DOM elements to add event listeners to. + * @param {EventListenerParam} eventListenerParam + * @param {string} target + * @param {Function} callback + * @returns {Array} Array of remove event listener functions. + */ + static addListener(elements, eventListenerParam, target, callback) { + let { action, eventType, target: customTarget } = eventListenerParam; + + if (customTarget) { + target = customTarget; + } + + if (!action) { + action = EVENT_TYPE_TO_ACTION[eventType]; + if (!action) { + return []; + } + } + + // Some events might have specific conditions we want to check before + // registering an engagement event. + let eventCallback; + if (eventListenerParam.condition) { + if (CONDITIONS[eventListenerParam.condition]) { + let condition = CONDITIONS[eventListenerParam.condition]; + eventCallback = async event => { + let start = Cu.now(); + if (condition(event)) { + callback({ action, target }); + } + ChromeUtils.addProfilerMarker( + "SearchSERPTelemetryChild._eventCallback", + start, + "Call cached function before callback." + ); + }; + } else { + // If a component included a condition, but it wasn't found it is + // due to the fact that it was added in a more recent Firefox version + // than what is provided via search-telemetry-v2. Since the version of + // Firefox the user is using doesn't include this condition, + // we shouldn't add the event. + return []; + } + } else { + eventCallback = () => { + callback({ action, target }); + }; + } + + let removeListenerCallbacks = []; + for (let element of elements) { + element.addEventListener(eventType, eventCallback); + removeListenerCallbacks.push(() => { + element.removeEventListener(eventType, eventCallback); + }); + } + return removeListenerCallbacks; + } +} + /** * Scans SERPs for ad components. */ @@ -252,12 +396,24 @@ class SearchAdImpression { // - For others, map its component type and check visibility. for (let [element, data] of this.#elementToAdDataMap.entries()) { if (data.type == "incontent_searchbox") { + // Bug 1880413: Deprecate hard coding the incontent search box. // If searchbox has child elements, observe those, otherwise // fallback to its parent element. - this.#addEventListenerToElements( - data.childElements.length ? data.childElements : [element], - data.type, - false + let searchElements = data.childElements.length + ? data.childElements + : [element]; + ListenerHelper.addListeners( + searchElements, + [ + { eventType: "click", target: data.type }, + { + eventType: "keydown", + target: data.type, + action: "submitted", + condition: "keydownEnter", + }, + ], + data.type ); continue; } @@ -352,6 +508,12 @@ class SearchAdImpression { if (!href) { return ""; } + + // Avoid extracting or fixing up Javascript URLs. + if (href.startsWith("javascript")) { + return ""; + } + // Hrefs can be relative. if (!href.startsWith("https://") && !href.startsWith("http://")) { href = origin + href; @@ -399,7 +561,19 @@ class SearchAdImpression { }); } if (result.relatedElements?.length) { - this.#addEventListenerToElements(result.relatedElements, result.type); + // Bug 1880413: Deprecate related elements. + // Bottom-up approach with related elements are only used for + // non-link elements related to ads, like carousel arrows. + ListenerHelper.addListeners( + result.relatedElements, + [ + { + action: "expanded", + eventType: "click", + }, + ], + result.type + ); } } } @@ -428,25 +602,60 @@ class SearchAdImpression { component.included.parent.selector ); if (parents.length) { + let eventListeners = component.included.parent.eventListeners; + if (eventListeners?.length) { + ListenerHelper.addListeners(parents, eventListeners, component.type); + } for (let parent of parents) { + // Bug 1880413: Deprecate related elements. + // Top-down related elements are either used for auto-suggested + // elements of a searchbox, or elements on a page which we can't + // find through a bottom up approach but we want an add a listener, + // like carousels with arrows. if (component.included.related?.selector) { - this.#addEventListenerToElements( - parent.querySelectorAll(component.included.related.selector), - component.type + let relatedElements = parent.querySelectorAll( + component.included.related.selector ); + if (relatedElements.length) { + // For the search box, related elements with event listeners are + // auto-suggested terms. For everything else (e.g. carousels) + // they are expanded. + ListenerHelper.addListeners( + relatedElements, + [ + { + action: + component.type == "incontent_searchbox" + ? "submitted" + : "expanded", + eventType: "click", + }, + ], + component.type + ); + } } if (component.included.children) { for (let child of component.included.children) { let childElements = parent.querySelectorAll(child.selector); if (childElements.length) { - this.#recordElementData(parent, { - type: component.type, - childElements: Array.from(childElements), - }); - break; + if (child.eventListeners) { + childElements = Array.from(childElements); + ListenerHelper.addListeners( + childElements, + child.eventListeners, + child.type ?? component.type + ); + } + if (!child.skipCount) { + this.#recordElementData(parent, { + type: component.type, + childElements: Array.from(childElements), + }); + } } } - } else { + } else if (!component.included.parent.skipCount) { this.#recordElementData(parent, { type: component.type, }); @@ -788,105 +997,6 @@ class SearchAdImpression { }); } } - - /** - * Adds a click listener to a specific element. - * - * @param {Array} elements - * DOM elements to add event listeners to. - * @param {string} type - * The component type of the element. - * @param {boolean} isRelated - * Whether the elements input are related to components or are actual - * components. - */ - #addEventListenerToElements(elements, type, isRelated = true) { - if (!elements?.length) { - return; - } - let clickAction = "clicked"; - let keydownEnterAction = "clicked"; - - switch (type) { - case "incontent_searchbox": - keydownEnterAction = "submitted"; - if (isRelated) { - // The related element to incontent_search are autosuggested elements - // which when clicked should cause different action than if the - // searchbox is clicked. - clickAction = "submitted"; - } - break; - case "ad_carousel": - case "refined_search_buttons": - if (isRelated) { - clickAction = "expanded"; - } - break; - } - - let document = elements[0].ownerGlobal.document; - let url = document.documentURI; - let callback = documentToEventCallbackMap.get(document); - - let removeListenerCallbacks = []; - - for (let element of elements) { - let clickCallback = () => { - if (clickAction == "submitted") { - documentToSubmitMap.set(document, true); - } - callback({ - type, - url, - action: clickAction, - }); - }; - element.addEventListener("click", clickCallback); - - let keydownCallback = event => { - if (event.key == "Enter") { - if (keydownEnterAction == "submitted") { - documentToSubmitMap.set(document, true); - } - callback({ - type, - url, - action: keydownEnterAction, - }); - } - }; - element.addEventListener("keydown", keydownCallback); - - removeListenerCallbacks.push(() => { - element.removeEventListener("click", clickCallback); - element.removeEventListener("keydown", keydownCallback); - }); - } - - document.ownerGlobal.addEventListener( - "pagehide", - () => { - let callbacks = documentToRemoveEventListenersMap.get(document); - if (callbacks) { - for (let removeEventListenerCallback of callbacks) { - removeEventListenerCallback(); - } - documentToRemoveEventListenersMap.delete(document); - } - }, - { once: true } - ); - - // The map might have entries from previous callers, so we must ensure - // we don't discard existing event listener callbacks. - if (documentToRemoveEventListenersMap.has(document)) { - let callbacks = documentToRemoveEventListenersMap.get(document); - removeListenerCallbacks = removeListenerCallbacks.concat(callbacks); - } - - documentToRemoveEventListenersMap.set(document, removeListenerCallbacks); - } } /** @@ -899,7 +1009,7 @@ class SearchAdImpression { * page that contain domains we want to extract. * @property {string} method * A string representing which domain extraction heuristic to use. - * One of: "href" or "data-attribute". + * One of: "href", "dataAttribute" or "textContent". * @property {object | null} options * Options related to the domain extraction heuristic used. * @property {string | null} options.dataAttributeKey @@ -922,10 +1032,12 @@ class DomainExtractor { * The document for the SERP we are extracting domains from. * @param {Array} extractorInfos * Information used to target the domains we need to extract. + * @param {string} providerName + * Name of the search provider. * @return {Set} * A set of the domains extracted from the page. */ - extractDomainsFromDocument(document, extractorInfos) { + extractDomainsFromDocument(document, extractorInfos, providerName) { let extractedDomains = new Set(); if (!extractorInfos?.length) { return extractedDomains; @@ -948,20 +1060,26 @@ class DomainExtractor { this.#fromElementsConvertHrefsIntoDomains( elements, origin, + providerName, extractedDomains, extractorInfo.options?.queryParamKey, extractorInfo.options?.queryParamValueIsHref ); break; } - case "data-attribute": { + case "dataAttribute": { this.#fromElementsRetrieveDataAttributeValues( elements, + providerName, extractorInfo.options?.dataAttributeKey, extractedDomains ); break; } + case "textContent": { + this.#fromElementsRetrieveTextContent(elements, extractedDomains); + break; + } } } @@ -979,6 +1097,8 @@ class DomainExtractor { * inspect. * @param {string} origin * Origin of the current page. + * @param {string} providerName + * The name of the search provider. * @param {Set} extractedDomains * The result set of domains extracted from the page. * @param {string | null} queryParam @@ -989,11 +1109,16 @@ class DomainExtractor { #fromElementsConvertHrefsIntoDomains( elements, origin, + providerName, extractedDomains, queryParam, queryParamValueIsHref ) { for (let element of elements) { + if (this.#exceedsThreshold(extractedDomains.size)) { + return; + } + let href = element.getAttribute("href"); let url; @@ -1016,12 +1141,16 @@ class DomainExtractor { } catch (e) { continue; } + paramValue = this.#processDomain(paramValue, providerName); } if (paramValue && !extractedDomains.has(paramValue)) { extractedDomains.add(paramValue); } - } else if (url.hostname && !extractedDomains.has(url.hostname)) { - extractedDomains.add(url.hostname); + } else if (url.hostname) { + let processedHostname = this.#processDomain(url.hostname, providerName); + if (processedHostname && !extractedDomains.has(processedHostname)) { + extractedDomains.add(processedHostname); + } } } } @@ -1034,6 +1163,8 @@ class DomainExtractor { * @param {NodeList} elements * A list of elements from the page whose data attributes we want to * inspect. + * @param {string} providerName + * The name of the search provider. * @param {string} attribute * The name of a data attribute to search for within an element. * @param {Set} extractedDomains @@ -1041,16 +1172,113 @@ class DomainExtractor { */ #fromElementsRetrieveDataAttributeValues( elements, + providerName, attribute, extractedDomains ) { for (let element of elements) { + if (this.#exceedsThreshold(extractedDomains.size)) { + return; + } let value = element.dataset[attribute]; + value = this.#processDomain(value, providerName); if (value && !extractedDomains.has(value)) { extractedDomains.add(value); } } } + + /* Given a list of elements, examine the text content for each element, which + * may be 1) a URL from which we can extract a domain or 2) text we can fix + * up to create a best guess as to a URL. If either condition is met, we add + * the domain to the result set. + * + * @param {NodeList} elements + * A list of elements from the page whose text content we want to inspect. + * @param {Set} extractedDomains + * The result set of domains extracted from the page. + */ + #fromElementsRetrieveTextContent(elements, extractedDomains) { + for (let element of elements) { + if (this.#exceedsThreshold(extractedDomains.size)) { + return; + } + let textContent = element.textContent; + if (!textContent) { + continue; + } + + let domain; + try { + domain = new URL(textContent).hostname; + } catch (e) { + domain = textContent.toLowerCase().replaceAll(" ", ""); + // If the attempt to turn the text content into a URL object only fails + // because we're missing a protocol, ".com" may already be present. + if (!domain.endsWith(".com")) { + domain = domain.concat(".com"); + } + } + if (!extractedDomains.has(domain)) { + extractedDomains.add(domain); + } + } + } + + /** + * Processes a raw domain extracted from the SERP into its final form before + * categorization. + * + * @param {string} domain + * The domain extracted from the page. + * @param {string} providerName + * The provider associated with the page. + * @returns {string} + * The domain without any subdomains. + */ + #processDomain(domain, providerName) { + if ( + domain.startsWith(`${providerName}.`) || + domain.includes(`.${providerName}.`) + ) { + return ""; + } + return this.#stripDomainOfSubdomains(domain); + } + + /** + * Helper to strip domains of any subdomains. + * + * @param {string} domain + * The domain to strip of any subdomains. + * @returns {object} browser + * The given domain with any subdomains removed. + */ + #stripDomainOfSubdomains(domain) { + let tld; + // Can throw an exception if the input has too few domain levels. + try { + tld = Services.eTLD.getKnownPublicSuffixFromHost(domain); + } catch (ex) { + return ""; + } + + let domainWithoutTLD = domain.substring(0, domain.length - tld.length); + let secondLevelDomain = domainWithoutTLD.split(".").at(-2); + + return secondLevelDomain ? `${secondLevelDomain}.${tld}` : ""; + } + + /** + * Per a request from Data Science, we need to limit the number of domains + * categorized to 10 non-ad domains and 10 ad domains. + * + * @param {number} nDomains The number of domains processed. + * @returns {boolean} Whether or not the threshold was exceeded. + */ + #exceedsThreshold(nDomains) { + return nDomains >= CATEGORIZATION_SETTINGS.MAX_DOMAINS_TO_CATEGORIZE; + } } export const domainExtractor = new DomainExtractor(); @@ -1149,8 +1377,11 @@ export class SearchSERPTelemetryChild extends JSWindowActorChild { let timerId = Glean.serp.categorizationDuration.start(); let pageActionCallback = info => { + if (info.action == "submitted") { + documentToSubmitMap.set(doc, true); + } this.sendAsyncMessage("SearchTelemetry:Action", { - type: info.type, + target: info.target, url: info.url, action: info.action, }); @@ -1191,11 +1422,13 @@ export class SearchSERPTelemetryChild extends JSWindowActorChild { let start = Cu.now(); let nonAdDomains = domainExtractor.extractDomainsFromDocument( doc, - providerInfo.domainExtraction.nonAds + providerInfo.domainExtraction.nonAds, + providerInfo.telemetryId ); let adDomains = domainExtractor.extractDomainsFromDocument( doc, - providerInfo.domainExtraction.ads + providerInfo.domainExtraction.ads, + providerInfo.telemetryId ); this.sendAsyncMessage("SearchTelemetry:Domains", { @@ -1287,6 +1520,13 @@ export class SearchSERPTelemetryChild extends JSWindowActorChild { break; } case "pagehide": { + let callbacks = documentToRemoveEventListenersMap.get(this.document); + if (callbacks) { + for (let removeEventListenerCallback of callbacks) { + removeEventListenerCallback(); + } + documentToRemoveEventListenersMap.delete(this.document); + } this.#cancelCheck(); break; } diff --git a/browser/actors/WebRTCChild.sys.mjs b/browser/actors/WebRTCChild.sys.mjs index 9febd74b05..50db01709d 100644 --- a/browser/actors/WebRTCChild.sys.mjs +++ b/browser/actors/WebRTCChild.sys.mjs @@ -95,7 +95,7 @@ export class WebRTCChild extends JSWindowActorChild { } // This observer is called from BrowserProcessChild to avoid - // loading this .jsm when WebRTC is not in use. + // loading this module when WebRTC is not in use. static observe(aSubject, aTopic, aData) { switch (aTopic) { case "getUserMedia:request": diff --git a/browser/app/macbuild/Contents/Info.plist.in b/browser/app/macbuild/Contents/Info.plist.in index bf7aac37a7..48fc32199b 100644 --- a/browser/app/macbuild/Contents/Info.plist.in +++ b/browser/app/macbuild/Contents/Info.plist.in @@ -237,7 +237,7 @@ Firefox Protocol CFBundleURLSchemes - firefox + firefox-bridge @@ -245,7 +245,7 @@ Firefox Private Browsing Protocol CFBundleURLSchemes - firefox-private + firefox-private-bridge diff --git a/browser/app/macbuild/Contents/MacOS-files.in b/browser/app/macbuild/Contents/MacOS-files.in index e3ed3b7b94..8c43996f34 100644 --- a/browser/app/macbuild/Contents/MacOS-files.in +++ b/browser/app/macbuild/Contents/MacOS-files.in @@ -16,6 +16,7 @@ #if defined(MOZ_CRASHREPORTER) /minidump-analyzer #endif +/nmhproxy /pingsender /pk12util /ssltunnel diff --git a/browser/app/moz.build b/browser/app/moz.build index a933a3cb9b..c731e9798a 100644 --- a/browser/app/moz.build +++ b/browser/app/moz.build @@ -135,6 +135,9 @@ if CONFIG["MOZ_SANDBOX"] and CONFIG["OS_ARCH"] == "WINNT": "usp10.dll", ] +if CONFIG["TARGET_OS"] in ("WINNT", "OSX"): + DIRS += ["nmhproxy"] + # Control the default heap size. # This is the heap returned by GetProcessHeap(). # As we use the CRT heap, the default size is too large and wastes VM. diff --git a/browser/app/nmhproxy/Cargo.toml b/browser/app/nmhproxy/Cargo.toml new file mode 100644 index 0000000000..14746d51b6 --- /dev/null +++ b/browser/app/nmhproxy/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "nmhproxy" +version = "0.1.0" +edition = "2021" +license = "MPL-2.0" +description = "A lightweight native messaging listener executable for the Firefox Bridge extension which launches Firefox in regular or private modes, avoiding the need to convert Firefox itself into a listener." + +[[bin]] +name = "nmhproxy" +path = "src/main.rs" + +[dependencies] +mozbuild = "0.1" +mozilla-central-workspace-hack = { version = "0.1", features = ["nmhproxy"], optional = true } +serde = { version = "1", features = ["derive", "rc"] } +serde_json = "1.0" +url = "2.4" diff --git a/browser/app/nmhproxy/moz.build b/browser/app/nmhproxy/moz.build new file mode 100644 index 0000000000..1f12e2880d --- /dev/null +++ b/browser/app/nmhproxy/moz.build @@ -0,0 +1,15 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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/. + +RUST_PROGRAMS += [ + "nmhproxy", +] + +# Ideally, the build system would set @rpath to be @executable_path as +# a default for this executable so that this addition to LDFLAGS would not be +# needed here. Bug 1772575 is filed to implement that. +if CONFIG["OS_ARCH"] == "Darwin": + LDFLAGS += ["-Wl,-rpath,@executable_path"] diff --git a/browser/app/nmhproxy/src/commands.rs b/browser/app/nmhproxy/src/commands.rs new file mode 100644 index 0000000000..29c86a0dd7 --- /dev/null +++ b/browser/app/nmhproxy/src/commands.rs @@ -0,0 +1,350 @@ +/* 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/. */ + +use serde::{Deserialize, Serialize}; +use std::io::{self, Read, Write}; +use std::process::Command; +use url::Url; + +#[cfg(target_os = "windows")] +const OS_NAME: &str = "windows"; + +#[cfg(target_os = "macos")] +const OS_NAME: &str = "macos"; + +#[derive(Serialize, Deserialize)] +#[serde(tag = "command", content = "data")] +// { +// "command": "LaunchFirefox", +// "data": {"url": "https://example.com"}, +// } +pub enum FirefoxCommand { + LaunchFirefox { url: String }, + LaunchFirefoxPrivate { url: String }, + GetVersion {}, +} +#[derive(Serialize, Deserialize)] +// { +// "message": "Successful launch", +// "result_code": 1, +// } +pub struct Response { + pub message: String, + pub result_code: u32, +} + +#[repr(u32)] +pub enum ResultCode { + Success = 0, + Error = 1, +} +impl From for u32 { + fn from(m: ResultCode) -> u32 { + m as u32 + } +} + +trait CommandRunner { + fn new() -> Self + where + Self: Sized; + fn arg(&mut self, arg: &str) -> &mut Self; + fn args(&mut self, args: &[&str]) -> &mut Self; + fn spawn(&mut self) -> std::io::Result<()>; + fn to_string(&mut self) -> std::io::Result; +} + +impl CommandRunner for Command { + fn new() -> Self { + #[cfg(target_os = "macos")] + { + Command::new("open") + } + #[cfg(target_os = "windows")] + { + use mozbuild::config::MOZ_APP_NAME; + use std::env; + use std::path::Path; + // Get the current executable's path, we know Firefox is in the + // same folder is nmhproxy.exe so we can use that. + let nmh_exe_path = env::current_exe().unwrap(); + let nmh_exe_folder = nmh_exe_path.parent().unwrap_or_else(|| Path::new("")); + let moz_exe_path = nmh_exe_folder.join(format!("{}.exe", MOZ_APP_NAME)); + Command::new(moz_exe_path) + } + } + fn arg(&mut self, arg: &str) -> &mut Self { + self.arg(arg) + } + fn args(&mut self, args: &[&str]) -> &mut Self { + self.args(args) + } + fn spawn(&mut self) -> std::io::Result<()> { + self.spawn().map(|_| ()) + } + fn to_string(&mut self) -> std::io::Result { + Ok("".to_string()) + } +} + +struct MockCommand { + command_line: String, +} + +impl CommandRunner for MockCommand { + fn new() -> Self { + MockCommand { + command_line: String::new(), + } + } + fn arg(&mut self, arg: &str) -> &mut Self { + self.command_line.push_str(arg); + self.command_line.push(' '); + self + } + fn args(&mut self, args: &[&str]) -> &mut Self { + for arg in args { + self.command_line.push_str(arg); + self.command_line.push(' '); + } + self + } + fn spawn(&mut self) -> std::io::Result<()> { + Ok(()) + } + fn to_string(&mut self) -> std::io::Result { + Ok(self.command_line.clone()) + } +} + +// The message length is a 32-bit integer in native byte order +pub fn read_message_length(mut reader: R) -> std::io::Result { + let mut buffer = [0u8; 4]; + reader.read_exact(&mut buffer)?; + let length: u32 = u32::from_ne_bytes(buffer); + if (length > 0) && (length < 100 * 1024) { + Ok(length) + } else { + Err(io::Error::new( + io::ErrorKind::InvalidData, + "Invalid message length", + )) + } +} + +pub fn read_message_string(mut reader: R, length: u32) -> io::Result { + let mut buffer = vec![0u8; length.try_into().unwrap()]; + reader.read_exact(&mut buffer)?; + let message = + String::from_utf8(buffer).map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?; + Ok(message) +} + +pub fn process_command(command: &FirefoxCommand) -> std::io::Result { + match &command { + FirefoxCommand::LaunchFirefox { url } => { + launch_firefox::(url.to_owned(), false, OS_NAME)?; + Ok(true) + } + FirefoxCommand::LaunchFirefoxPrivate { url } => { + launch_firefox::(url.to_owned(), true, OS_NAME)?; + Ok(true) + } + FirefoxCommand::GetVersion {} => generate_response("1", ResultCode::Success.into()), + } +} + +pub fn generate_response(message: &str, result_code: u32) -> std::io::Result { + let response_struct = Response { + message: message.to_string(), + result_code, + }; + let response_str = serde_json::to_string(&response_struct) + .map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidData, e))?; + let response_len_bytes: [u8; 4] = (response_str.len() as u32).to_ne_bytes(); + std::io::stdout().write_all(&response_len_bytes)?; + std::io::stdout().write_all(response_str.as_bytes())?; + std::io::stdout().flush()?; + Ok(true) +} + +fn validate_url(url: String) -> std::io::Result { + let parsed_url = Url::parse(url.as_str()) + .map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidData, e))?; + match parsed_url.scheme() { + "http" | "https" | "file" => Ok(parsed_url.to_string()), + _ => Err(std::io::Error::new( + std::io::ErrorKind::InvalidInput, + "Invalid URL scheme", + )), + } +} + +fn launch_firefox( + url: String, + private: bool, + os: &str, +) -> std::io::Result { + let validated_url: String = validate_url(url)?; + let mut command = C::new(); + if os == "macos" { + use mozbuild::config::MOZ_MACBUNDLE_ID; + let mut args: [&str; 2] = ["--args", "-url"]; + if private { + args[1] = "-private-window"; + } + command + .arg("-n") + .arg("-b") + .arg(MOZ_MACBUNDLE_ID) + .args(&args) + .arg(validated_url.as_str()); + } else if os == "windows" { + let mut args: [&str; 2] = ["-osint", "-url"]; + if private { + args[1] = "-private-window"; + } + command.args(&args).arg(validated_url.as_str()); + } + match command.spawn() { + Ok(_) => generate_response( + if private { + "Successful private launch" + } else { + "Sucessful launch" + }, + ResultCode::Success.into(), + )?, + Err(_) => generate_response( + if private { + "Failed private launch" + } else { + "Failed launch" + }, + ResultCode::Error.into(), + )?, + }; + command.to_string() +} + +#[cfg(test)] +mod tests { + use super::*; + use std::io::Cursor; + #[test] + fn test_validate_url() { + let valid_test_cases = vec![ + "https://example.com/".to_string(), + "http://example.com/".to_string(), + "file:///path/to/file".to_string(), + "https://test.example.com/".to_string(), + ]; + + for input in valid_test_cases { + let result = validate_url(input.clone()); + assert!(result.is_ok(), "Expected Ok, got Err"); + // Safe to unwrap because we know the result is Ok + let ok_value = result.unwrap(); + assert_eq!(ok_value, input); + } + + assert!(matches!( + validate_url("fakeprotocol://test.example.com/".to_string()).map_err(|e| e.kind()), + Err(std::io::ErrorKind::InvalidInput) + )); + + assert!(matches!( + validate_url("invalidURL".to_string()).map_err(|e| e.kind()), + Err(std::io::ErrorKind::InvalidData) + )); + } + + #[test] + fn test_read_message_length_valid() { + let input: [u8; 4] = 256u32.to_ne_bytes(); + let mut cursor = Cursor::new(input); + let length = read_message_length(&mut cursor); + assert!(length.is_ok(), "Expected Ok, got Err"); + assert_eq!(length.unwrap(), 256); + } + + #[test] + fn test_read_message_length_invalid_too_large() { + let input: [u8; 4] = 1_000_000u32.to_ne_bytes(); + let mut cursor = Cursor::new(input); + let result = read_message_length(&mut cursor); + assert!(result.is_err()); + let error = result.err().unwrap(); + assert_eq!(error.kind(), io::ErrorKind::InvalidData); + } + + #[test] + fn test_read_message_length_invalid_zero() { + let input: [u8; 4] = 0u32.to_ne_bytes(); + let mut cursor = Cursor::new(input); + let result = read_message_length(&mut cursor); + assert!(result.is_err()); + let error = result.err().unwrap(); + assert_eq!(error.kind(), io::ErrorKind::InvalidData); + } + + #[test] + fn test_read_message_string_valid() { + let input_data = b"Valid UTF8 string!"; + let input_length = input_data.len() as u32; + let message = read_message_string(&input_data[..], input_length); + assert!(message.is_ok(), "Expected Ok, got Err"); + assert_eq!(message.unwrap(), "Valid UTF8 string!"); + } + + #[test] + fn test_read_message_string_invalid() { + let input_data: [u8; 3] = [0xff, 0xfe, 0xfd]; + let input_length = input_data.len() as u32; + let result = read_message_string(&input_data[..], input_length); + assert!(result.is_err()); + let error = result.err().unwrap(); + assert_eq!(error.kind(), io::ErrorKind::InvalidData); + } + + #[test] + fn test_launch_regular_command_macos() { + let url = "https://example.com"; + let result = launch_firefox::(url.to_string(), false, "macos"); + assert!(result.is_ok()); + let command_line = result.unwrap(); + let correct_url_format = format!("-url {}", url); + assert!(command_line.contains(correct_url_format.as_str())); + } + + #[test] + fn test_launch_regular_command_windows() { + let url = "https://example.com"; + let result = launch_firefox::(url.to_string(), false, "windows"); + assert!(result.is_ok()); + let command_line = result.unwrap(); + let correct_url_format = format!("-osint -url {}", url); + assert!(command_line.contains(correct_url_format.as_str())); + } + + #[test] + fn test_launch_private_command_macos() { + let url = "https://example.com"; + let result = launch_firefox::(url.to_string(), true, "macos"); + assert!(result.is_ok()); + let command_line = result.unwrap(); + let correct_url_format = format!("-private-window {}", url); + assert!(command_line.contains(correct_url_format.as_str())); + } + + #[test] + fn test_launch_private_command_windows() { + let url = "https://example.com"; + let result = launch_firefox::(url.to_string(), true, "windows"); + assert!(result.is_ok()); + let command_line = result.unwrap(); + let correct_url_format = format!("-osint -private-window {}", url); + assert!(command_line.contains(correct_url_format.as_str())); + } +} diff --git a/browser/app/nmhproxy/src/main.rs b/browser/app/nmhproxy/src/main.rs new file mode 100644 index 0000000000..de9cd8c2a3 --- /dev/null +++ b/browser/app/nmhproxy/src/main.rs @@ -0,0 +1,55 @@ +/* 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/. */ + +mod commands; +use commands::ResultCode; +use std::io::Error; +use std::io::ErrorKind; + +fn main() -> Result<(), Error> { + // The general structure of these functions is to print error cases to + // stdout so that the extension can read them and then do error-handling + // on that end. + let message_length: u32 = + commands::read_message_length(std::io::stdin()).or_else(|_| -> Result { + commands::generate_response("Failed to read message length", ResultCode::Error.into()) + .expect("JSON error"); + return Err(Error::new( + ErrorKind::InvalidInput, + "Failed to read message length", + )); + })?; + let message: String = commands::read_message_string(std::io::stdin(), message_length).or_else( + |_| -> Result { + commands::generate_response("Failed to read message", ResultCode::Error.into()) + .expect("JSON error"); + return Err(Error::new( + ErrorKind::InvalidInput, + "Failed to read message", + )); + }, + )?; + // Deserialize the message with the following expected format + let native_messaging_json: commands::FirefoxCommand = + serde_json::from_str(&message).or_else(|_| -> Result { + commands::generate_response( + "Failed to deserialize message JSON", + ResultCode::Error.into(), + ) + .expect("JSON error"); + return Err(Error::new( + ErrorKind::InvalidInput, + "Failed to deserialize message JSON", + )); + })?; + commands::process_command(&native_messaging_json).or_else(|_| -> Result { + commands::generate_response("Failed to process command", ResultCode::Error.into()) + .expect("JSON error"); + return Err(Error::new( + ErrorKind::InvalidInput, + "Failed to process command", + )); + })?; + Ok(()) +} diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 5964d40ca3..1ef5a05907 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -57,7 +57,7 @@ pref("extensions.systemAddon.update.url", "https://aus5.mozilla.org/update/3/Sys pref("extensions.systemAddon.update.enabled", true); // Disable add-ons that are not installed by the user in all scopes by default. -// See the SCOPE constants in AddonManager.jsm for values to use here. +// See the SCOPE constants in AddonManager.sys.mjs for values to use here. pref("extensions.autoDisableScopes", 15); // Scopes to scan for changes at startup. pref("extensions.startupScanScopes", 0); @@ -295,12 +295,6 @@ pref("browser.shell.checkDefaultPDF", true); // Will be set to `true` if the user indicates that they don't want to be asked // again about Firefox being their default PDF handler any more. pref("browser.shell.checkDefaultPDF.silencedByUser", false); -// URL to navigate to when launching Firefox after accepting the Windows Default -// Browser Agent "Set Firefox as default" call to action. -pref("browser.shell.defaultBrowserAgent.thanksURL", "https://www.mozilla.org/%LOCALE%/firefox/set-as-default/thanks/"); -// Whether or not we want to run through the early startup idle task -// which registers the firefox and firefox-private registry keys. -pref("browser.shell.customProtocolsRegistered", false); #endif @@ -439,12 +433,8 @@ pref("browser.search.param.search_rich_suggestions", "fen"); // Feature gate pref for weather suggestions in the urlbar. pref("browser.urlbar.weather.featureGate", false); -// Enable clipboard suggestions in Nightly. -#ifdef NIGHTLY_BUILD +// Enable clipboard suggestions feature, the pref should be removed once stable. pref("browser.urlbar.clipboard.featureGate", true); -#else -pref("browser.urlbar.clipboard.featureGate", false); -#endif // When false, the weather suggestion will not be fetched when a VPN is // detected. When true, it will be fetched anyway. @@ -556,11 +546,7 @@ pref("browser.urlbar.switchTabs.adoptIntoActiveWindow", false); // Controls whether searching for open tabs returns tabs from any container // or only from the current container. -#ifdef NIGHTLY_BUILD pref("browser.urlbar.switchTabs.searchAllContainers", true); -#else -pref("browser.urlbar.switchTabs.searchAllContainers", false); -#endif // Whether addresses and search results typed into the address bar // should be opened in new tabs by default. @@ -732,6 +718,13 @@ pref("browser.download.clearHistoryOnDelete", 0); pref("browser.helperApps.showOpenOptionForPdfJS", true); pref("browser.helperApps.showOpenOptionForViewableInternally", true); +// Whether search-config-v2 is enabled. +#ifdef NIGHTLY_BUILD +pref("browser.search.newSearchConfig.enabled", true); +#else +pref("browser.search.newSearchConfig.enabled", false); +#endif + // search engines URL pref("browser.search.searchEnginesURL", "https://addons.mozilla.org/%LOCALE%/firefox/search-engines/"); @@ -949,7 +942,6 @@ pref("browser.tabs.tooltipsShowPidAndActiveness", false); #endif pref("browser.tabs.cardPreview.enabled", false); -pref("browser.tabs.cardPreview.delayMs", 1000); pref("browser.tabs.cardPreview.showThumbnails", true); pref("browser.tabs.firefox-view", true); @@ -1079,6 +1071,17 @@ pref("privacy.cpd.offlineApps", false); pref("privacy.cpd.siteSettings", false); pref("privacy.cpd.openWindows", false); +// clearHistory and clearSiteData pref branches are used to +// remember user pref options based on the two different entry points +pref("privacy.clearHistory.historyFormDataAndDownloads", true); +pref("privacy.clearHistory.cookiesAndStorage", true); +pref("privacy.clearHistory.cache", true); +pref("privacy.clearHistory.siteSettings", false); +pref("privacy.clearSiteData.historyFormDataAndDownloads", false); +pref("privacy.clearSiteData.cookiesAndStorage", true); +pref("privacy.clearSiteData.cache", true); +pref("privacy.clearSiteData.siteSettings", false); + pref("privacy.history.custom", false); // What default should we use for the time span in the sanitizer: @@ -1097,7 +1100,10 @@ pref("privacy.sanitize.useOldClearHistoryDialog", false); pref("privacy.sanitize.useOldClearHistoryDialog", true); #endif -pref("privacy.sanitize.sanitizeOnShutdown.hasMigratedToNewPrefs", false); +pref("privacy.sanitize.clearOnShutdown.hasMigratedToNewPrefs", false); +// flag to track migration of clear history dialog prefs, where cpd stands for +// clear private data +pref("privacy.sanitize.cpd.hasMigratedToNewPrefs", false); pref("privacy.panicButton.enabled", true); @@ -1301,8 +1307,6 @@ pref("browser.sessionstore.upgradeBackup.maxUpgradeBackups", 3); pref("browser.sessionstore.debug", false); // Forget closed windows/tabs after two weeks pref("browser.sessionstore.cleanup.forget_closed_after", 1209600000); -// Platform collects session storage data for session store -pref("browser.sessionstore.collect_session_storage", true); // temporary pref that will be removed in a future release, see bug 1836952 pref("browser.sessionstore.persist_closed_tabs_between_sessions", true); @@ -1418,11 +1422,7 @@ pref("browser.bookmarks.editDialog.maxRecentFolders", 7); // On windows these levels are: // See - security/sandbox/win/src/sandboxbroker/sandboxBroker.cpp // SetSecurityLevelForContentProcess() for what the different settings mean. - #if defined(NIGHTLY_BUILD) - pref("security.sandbox.content.level", 7); - #else - pref("security.sandbox.content.level", 6); - #endif + pref("security.sandbox.content.level", 6); // Pref controlling if messages relevant to sandbox violations are logged. pref("security.sandbox.logging.enabled", false); @@ -1763,6 +1763,7 @@ pref("browser.newtabpage.activity-stream.discoverystream.spocTopsitesPlacement.e pref("browser.newtabpage.activity-stream.discoverystream.spocSiteId", ""); pref("browser.newtabpage.activity-stream.discoverystream.ctaButtonSponsors", ""); pref("browser.newtabpage.activity-stream.discoverystream.ctaButtonVariant", ""); +pref("browser.newtabpage.activity-stream.discoverystream.spocMessageVariant", ""); pref("browser.newtabpage.activity-stream.discoverystream.sendToPocket.enabled", true); @@ -1854,6 +1855,8 @@ pref("pdfjs.previousHandler.alwaysAskBeforeHandling", false); // Try to convert PDFs sent as octet-stream pref("pdfjs.handleOctetStream", true); +pref("sidebar.companion", false); + // Is the sidebar positioned ahead of the content browser pref("sidebar.position_start", true); @@ -2102,8 +2105,6 @@ pref("browser.contentblocking.features.strict", "tp,tpPrivate,cookieBehavior5,co // lists enabled. pref("browser.contentblocking.customBlockList.preferences.ui.enabled", false); -pref("browser.contentblocking.reportBreakage.url", "https://tracking-protection-issues.herokuapp.com/new"); - // Enable Protections report's Lockwise card by default. pref("browser.contentblocking.report.lockwise.enabled", true); @@ -2324,8 +2325,6 @@ pref("browser.migrate.interactions.passwords", false); pref("browser.migrate.preferences-entrypoint.enabled", true); -pref("browser.device-migration.help-menu.hidden", false); - pref("extensions.pocket.api", "api.getpocket.com"); pref("extensions.pocket.bffApi", "firefox-api-proxy.cdn.mozilla.net"); pref("extensions.pocket.bffRecentSaves", true); @@ -2406,8 +2405,12 @@ pref("browser.suppress_first_window_animation", true); // Preference that allows individual users to disable Screenshots. pref("extensions.screenshots.disabled", false); -// Preference that determines whether Screenshots is opened as a dedicated browser component -pref("screenshots.browser.component.enabled", false); +// Preference that determines whether Screenshots uses the dedicated browser component +#ifdef NIGHTLY_BUILD + pref("screenshots.browser.component.enabled", true); +#else + pref("screenshots.browser.component.enabled", false); +#endif // Preference that determines what button to focus pref("screenshots.browser.component.last-saved-method", "download"); @@ -2491,8 +2494,6 @@ pref("browser.toolbars.bookmarks.showOtherBookmarks", true); // Felt Privacy pref to control simplified private browsing UI pref("browser.privatebrowsing.felt-privacy-v1", false); -// Visiblity of the bookmarks toolbar in PBM (currently only applies if felt-privacy-v1 is true) -pref("browser.toolbars.bookmarks.showInPrivateBrowsing", false); // Prefs to control the Firefox Account toolbar menu. // This pref will surface existing Firefox Account information @@ -2503,7 +2504,7 @@ pref("identity.fxaccounts.toolbar.accessed", false); pref("identity.fxaccounts.toolbar.defaultVisible", true); // Prefs to control Firefox Account panels that shows call to actions -// for other supported Mozilla products +// for other supported Mozilla products pref("identity.fxaccounts.toolbar.pxiToolbarEnabled", false); pref("identity.fxaccounts.toolbar.pxiToolbarEnabled.monitorEnabled", true); pref("identity.fxaccounts.toolbar.pxiToolbarEnabled.relayEnabled", true); @@ -2922,6 +2923,13 @@ pref("svg.context-properties.content.allowed-domains", "profile.accounts.firefox pref("extensions.translations.disabled", true); #endif +#if defined(XP_MACOSX) || defined(XP_WIN) +pref("browser.firefoxbridge.enabled", false); +pref("browser.firefoxbridge.extensionOrigins", + "chrome-extension://gkcbmfjnnjoambnfmihmnkneakghogca/" +); +#endif + // Turn on interaction measurements pref("browser.places.interactions.enabled", true); @@ -3016,9 +3024,16 @@ pref("ui.new-webcompat-reporter.reason-dropdown.randomized", true); pref("browser.privatebrowsing.resetPBM.showConfirmationDialog", true); // the preferences related to the Nimbus experiment, to activate and deactivate -// the the entire rollout or deactivate only the OS prompt (see: bug 1864216) +// the the entire rollout (see: bug 1864216 - two prompts, 1877500 - set two in one prompt) pref("browser.mailto.dualPrompt", false); -pref("browser.mailto.dualPrompt.os", false); // When visiting a site which uses registerProtocolHandler: Ask the user to set Firefox as // default mailto handler. pref("browser.mailto.prompt.os", true); + +pref("browser.backup.enabled", false); + +// Pref to enable the new profiles +pref("browser.profiles.enabled", false); + +pref("startup.homepage_override_url_nimbus", ""); +pref("startup.homepage_override_nimbus_maxVersion", ""); diff --git a/browser/app/winlauncher/LauncherProcessWin.cpp b/browser/app/winlauncher/LauncherProcessWin.cpp index b40e0fceb5..81d4ee91e9 100644 --- a/browser/app/winlauncher/LauncherProcessWin.cpp +++ b/browser/app/winlauncher/LauncherProcessWin.cpp @@ -401,8 +401,12 @@ Maybe LauncherMain(int& argc, wchar_t* argv[], } #endif // defined(MOZ_LAUNCHER_PROCESS) - // Now proceed with setting up the parameters for process creation - UniquePtr cmdLine(MakeCommandLine(argc, argv)); + // Now proceed with setting up the parameters for process creation. + constexpr static const wchar_t* extraArgs[] = { + L"/prefetch:1", // for APFL; see ipc/glue/GeckoChildProcessHost.cpp + }; + UniquePtr cmdLine( + MakeCommandLine(argc, argv, ARRAYSIZE(extraArgs), extraArgs)); if (!cmdLine) { HandleLauncherError(LAUNCHER_ERROR_GENERIC()); return Nothing(); diff --git a/browser/app/winlauncher/freestanding/DllBlocklist.cpp b/browser/app/winlauncher/freestanding/DllBlocklist.cpp index bfb3d6239b..f8f9560acb 100644 --- a/browser/app/winlauncher/freestanding/DllBlocklist.cpp +++ b/browser/app/winlauncher/freestanding/DllBlocklist.cpp @@ -11,7 +11,6 @@ #include "mozilla/Types.h" #include "mozilla/WindowsDllBlocklist.h" -#include "CrashAnnotations.h" #include "DllBlocklist.h" #include "LoaderPrivateAPI.h" #include "ModuleLoadFrame.h" @@ -136,12 +135,8 @@ void NativeNtBlockSet::Write(WritableBuffer& aBuffer) { static NativeNtBlockSet gBlockSet; -extern "C" void MOZ_EXPORT -NativeNtBlockSet_Write(CrashReporter::AnnotationWriter& aWriter) { - WritableBuffer buffer; - gBlockSet.Write(buffer); - aWriter.Write(CrashReporter::Annotation::BlockedDllList, buffer.Data(), - buffer.Length()); +extern "C" void MOZ_EXPORT NativeNtBlockSet_Write(WritableBuffer& aBuffer) { + gBlockSet.Write(aBuffer); } enum class BlockAction { diff --git a/browser/base/content/appmenu-viewcache.inc.xhtml b/browser/base/content/appmenu-viewcache.inc.xhtml index 07b1765f18..04bba182fb 100644 --- a/browser/base/content/appmenu-viewcache.inc.xhtml +++ b/browser/base/content/appmenu-viewcache.inc.xhtml @@ -38,6 +38,13 @@ +