diff --git a/extras.ini b/extras.ini index 43535d26..48c70f7f 100644 --- a/extras.ini +++ b/extras.ini @@ -3,3 +3,18 @@ url = https://gist.githubusercontent.com/dumbmoron/a8aeb8926c4baa8fdd0fa8e8de47e download_filename = icons.tar.gz sha256 = cd954c7257f126be871f79ecf8fff143425708d5d33501d0ba870fa466dafbe7 output_path = ./components/resources/default_100_percent/search_engine_choice + +[onboarding] +version = e31596cca3088fed99660589867dd111f13abe1f +url = https://github.com/imputnet/helium-onboarding/archive/%(version)s.tar.gz +download_filename = onboarding-page-%(version)s.tar.gz +sha256 = eb44fde5ab8abd989ff82770e10515423f705d15f50c07faa28b03b67999bce8 +output_path = ./components/helium_onboarding +strip_leading_dirs = helium-onboarding-%(version)s + +[onboarding_node_modules] +version = fb4219d06c196d32847d93ccbbfdb48ded0238d2 +url = https://gist.github.com/dumbmoron/26e60eb4c6908abb384ea7147c8bce32/raw/%(version)s/node_modules.tar.gz +download_filename = onboarding-node_modules-%(version)s.tar.gz +sha256 = 2fa3b8cbfc6c2da9522f625adcef39c16ed227793916393b7438138224e38409 +output_path = ./components/helium_onboarding/node_modules diff --git a/patches/extra/ungoogled-chromium/first-run-page.patch b/patches/extra/ungoogled-chromium/first-run-page.patch deleted file mode 100644 index 30755633..00000000 --- a/patches/extra/ungoogled-chromium/first-run-page.patch +++ /dev/null @@ -1,185 +0,0 @@ ---- a/chrome/browser/chrome_browser_main.cc -+++ b/chrome/browser/chrome_browser_main.cc -@@ -1013,6 +1013,7 @@ int ChromeBrowserMainParts::PreCreateThr - if (first_run::IsChromeFirstRun()) { - if (!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kApp) && - !base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kAppId)) { -+ browser_creator_->AddFirstRunTabs({GURL("chrome://ungoogled-first-run")}); - browser_creator_->AddFirstRunTabs(master_prefs_->new_tabs); - } - ---- a/chrome/browser/ui/webui/chrome_web_ui_configs.cc -+++ b/chrome/browser/ui/webui/chrome_web_ui_configs.cc -@@ -43,6 +43,7 @@ - #include "chrome/browser/ui/webui/signin_internals_ui.h" - #include "chrome/browser/ui/webui/sync_internals/sync_internals_ui.h" - #include "chrome/browser/ui/webui/translate_internals/translate_internals_ui.h" -+#include "chrome/browser/ui/webui/ungoogled_first_run.h" - #include "chrome/browser/ui/webui/usb_internals/usb_internals_ui.h" - #include "chrome/browser/ui/webui/user_actions/user_actions_ui.h" - #include "chrome/browser/ui/webui/version/version_ui.h" -@@ -248,6 +249,7 @@ void RegisterChromeWebUIConfigs() { - map.AddWebUIConfig(std::make_unique()); - map.AddWebUIConfig(std::make_unique()); - map.AddWebUIConfig(std::make_unique()); -+ map.AddWebUIConfig(std::make_unique()); - map.AddWebUIConfig(std::make_unique()); - map.AddWebUIConfig(std::make_unique()); - map.AddWebUIConfig(std::make_unique()); ---- /dev/null -+++ b/chrome/browser/ui/webui/ungoogled_first_run.h -@@ -0,0 +1,144 @@ -+#ifndef CHROME_BROWSER_UI_WEBUI_UNGOOGLED_FIRST_RUN_H_ -+#define CHROME_BROWSER_UI_WEBUI_UNGOOGLED_FIRST_RUN_H_ -+ -+#include "base/memory/ref_counted_memory.h" -+#include "chrome/browser/profiles/profile.h" -+#include "content/public/browser/url_data_source.h" -+#include "content/public/browser/web_ui.h" -+#include "content/public/browser/web_ui_controller.h" -+#include "content/public/browser/webui_config.h" -+#include "services/network/public/mojom/content_security_policy.mojom.h" -+ -+class UFRDataSource : public content::URLDataSource { -+ public: -+ UFRDataSource() {} -+ UFRDataSource(const UFRDataSource&) = delete; -+ UFRDataSource& operator=(const UFRDataSource&) = delete; -+ std::string GetSource() { return "ungoogled-first-run"; } -+ std::string GetMimeType(const GURL& url) { return "text/html"; } -+ std::string GetContentSecurityPolicy(network::mojom::CSPDirectiveName directive) { -+ if (directive == network::mojom::CSPDirectiveName::ScriptSrc) -+ return "script-src 'unsafe-inline'"; -+ return std::string(); -+ } -+ void StartDataRequest(const GURL& url, -+ const content::WebContents::Getter& wc_getter, -+ GotDataCallback callback) { -+ std::string source = R"( -+ungoogled-chromium first run page -+ -+ -+ -+
-+

ungoogled-chromium

-+ This browser was built with ungoogled-chromium patches and differs from the default Chromium experience -+ in a few ways. Look over the sections below and the -+ -+ changes to the default settings to see what may be important to you.

-+ This page can always be accessed again at chrome://ungoogled-first-run -+

-+
-+

How-To

-+
Install and update extensions
-+ NeverDecaf has created an extension to make this process easy: -+
    -+
  1. Set chrome://flags/#extension-mime-request-handling -+ to Always prompt for install and relaunch.
  2. -+
  3. Then click on the latest Chromium.Web.Store.crx link on -+ the extension's Releases page.
  4. -+
-+ Please check out the chromium-web-store -+ repo for further details and alternate installation methods for the extension.

-+ If you do not wish to install this extension, there is still a way to install other extensions albeit -+ without the ability to easily update them. In this case, please refer to the entry on the wiki for -+ -+ installing extensions manually.
-+
Enable spellcheck -+
    -+
  1. Go to -+ https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries/+/main
  2. -+
  3. Find a bdic file for the language you want and click on it. -+ You will see a mostly empty page aside from "X-byte binary file".
  4. -+
  5. On the bottom right corner, click "txt". The direct link for en-US-10-1.bdic is: -+ -+ https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries/+/main/en-US-10-1.bdic?format=TEXT
  6. -+
  7. This is a base64-encoded file that needs to be decoded. Use the button below to select the .txt file you saved -+ and save/move the resulting bdic file to your Dictionaries directory. Default locations: -+
      -+
    • Linux: ~/.config/chromium/Dictionaries/
    • -+
    • Mac: ~/Library/Application Support/Chromium/Dictionaries/
    • -+
    • Windows: %LOCALAPPDATA%\Chromium\User Data\Dictionaries\
    • -+
    -+ -+
  8. -+
  9. Toggle spell check in chrome://settings/languages, -+ or restart the browser for the dictionaries to take effect.
  10. -+

-+ Check out the FAQ on the wiki -+ for information on other common topics. -+

-+
-+

Extra Features

-+ Most features introduced by ungoogled-chromium are disabled by default and can be enabled in -+ chrome://flags or as command-line switches. Take a look at -+ -+ the flags documentation to see what features you may find useful to enable. -+

-+
-+

Additional Links

-+ Privacy and security information, motivation and philosophy, rationale for changes, and more can be found in the -+ README.

-+ Visit our -+ support page if you wish to report problems.

-+ Are you a developer? Consider -+ -+ contributing to ungoogled-chromium! -+

-+ -+)"; -+ std::move(callback).Run(base::MakeRefCounted(std::move(source))); -+ } -+}; -+ -+class UngoogledFirstRun; -+class UngoogledFirstRunUIConfig : public content::DefaultWebUIConfig { -+ public: -+ UngoogledFirstRunUIConfig() : DefaultWebUIConfig("chrome", "ungoogled-first-run") {} -+}; -+ -+class UngoogledFirstRun : public content::WebUIController { -+ public: -+ UngoogledFirstRun(content::WebUI* web_ui) : content::WebUIController(web_ui) { -+ content::URLDataSource::Add(Profile::FromWebUI(web_ui), std::make_unique()); -+ } -+ UngoogledFirstRun(const UngoogledFirstRun&) = delete; -+ UngoogledFirstRun& operator=(const UngoogledFirstRun&) = delete; -+}; -+ -+#endif // CHROME_BROWSER_UI_WEBUI_UNGOOGLED_FIRST_RUN_H_ ---- a/chrome/common/webui_url_constants.cc -+++ b/chrome/common/webui_url_constants.cc -@@ -71,6 +71,7 @@ bool IsSystemWebUIHost(std::string_view - // These hosts will also be suggested by BuiltinProvider. - base::span ChromeURLHosts() { - static constexpr auto kChromeURLHosts = std::to_array({ -+ "ungoogled-first-run", - kChromeUIAboutHost, - kChromeUIAccessibilityHost, - #if !BUILDFLAG(IS_ANDROID) diff --git a/patches/helium/onboarding-page.patch b/patches/helium/onboarding-page.patch new file mode 100644 index 00000000..21535188 --- /dev/null +++ b/patches/helium/onboarding-page.patch @@ -0,0 +1,164 @@ +--- a/tools/gritsettings/resource_ids.spec ++++ b/tools/gritsettings/resource_ids.spec +@@ -1103,6 +1103,10 @@ + "META": {"sizes": {"includes": [30],}}, + "includes": [7480], + }, ++ "<(SHARED_INTERMEDIATE_DIR)/components/helium_onboarding/resources.grd": { ++ "META": {"sizes": {"includes": [30],}}, ++ "includes": [7510], ++ }, + # END components/ section. + + # START ios/ section. +--- a/chrome/browser/BUILD.gn ++++ b/chrome/browser/BUILD.gn +@@ -8409,6 +8409,7 @@ static_library("browser_generated_files" + "//chrome/browser/ui/webui/user_education_internals:mojo_bindings", + "//chrome/browser/v8_compile_hints/proto", + "//chrome/browser/web_applications/mojom:mojom_web_apps_enum", ++ "//components/helium_onboarding:generated_resources", + ] + if (is_android) { + public_deps += [ +--- a/chrome/chrome_paks.gni ++++ b/chrome/chrome_paks.gni +@@ -435,11 +435,13 @@ template("chrome_extra_paks") { + if (!is_android && !is_chromeos_ash) { + sources += [ + "$root_gen_dir/chrome/intro_resources.pak", ++ "$root_gen_dir/components/helium_onboarding/resources/helium_onboarding_generated.pak", + "$root_gen_dir/chrome/profile_picker_resources.pak", + ] + deps += [ + "//chrome/browser/resources/intro:resources", + "//chrome/browser/resources/signin/profile_picker:resources", ++ "//components/helium_onboarding:generated_resources", + ] + } + +--- a/chrome/common/webui_url_constants.cc ++++ b/chrome/common/webui_url_constants.cc +@@ -116,6 +116,7 @@ base::span Chr + kChromeUIPrefsInternalsHost, + kChromeUIProfileInternalsHost, + content::kChromeUIQuotaInternalsHost, ++ kHeliumSetupHost, + kChromeUISignInInternalsHost, + kChromeUISiteEngagementHost, + #if !BUILDFLAG(IS_ANDROID) +--- a/chrome/common/webui_url_constants.h ++++ b/chrome/common/webui_url_constants.h +@@ -556,6 +556,8 @@ inline constexpr char kChromeUIProfilePi + inline constexpr char kChromeUIProfilePickerStartupQuery[] = "startup"; + inline constexpr char kChromeUIProfilePickerGlicQuery[] = "glic"; + inline constexpr char kChromeUIProfilePickerUrl[] = "chrome://profile-picker/"; ++inline constexpr char kHeliumSetupHost[] = "setup"; ++inline constexpr char kHeliumSetupURL[] = "chrome://setup"; + #endif + + #if ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \ +--- a/chrome/browser/ui/BUILD.gn ++++ b/chrome/browser/ui/BUILD.gn +@@ -230,6 +230,8 @@ static_library("ui") { + "webui/net_internals/net_internals_ui.h", + "webui/ntp_tiles_internals_ui.cc", + "webui/ntp_tiles_internals_ui.h", ++ "webui/onboarding/onboarding_page_ui.cc", ++ "webui/onboarding/onboarding_page_ui.h", + "webui/omnibox/omnibox_page_handler.cc", + "webui/omnibox/omnibox_page_handler.h", + "webui/omnibox/omnibox_ui.cc", +--- a/chrome/browser/ui/webui/chrome_web_ui_configs.cc ++++ b/chrome/browser/ui/webui/chrome_web_ui_configs.cc +@@ -34,6 +34,7 @@ + #include "chrome/browser/ui/webui/net_export_ui.h" + #include "chrome/browser/ui/webui/net_internals/net_internals_ui.h" + #include "chrome/browser/ui/webui/ntp_tiles_internals_ui.h" ++#include "chrome/browser/ui/webui/onboarding/onboarding_page_ui.h" + #include "chrome/browser/ui/webui/omnibox/omnibox_ui.h" + #include "chrome/browser/ui/webui/policy/policy_ui.h" + #include "chrome/browser/ui/webui/predictors/predictors_ui.h" +@@ -383,6 +384,7 @@ void RegisterChromeWebUIConfigs() { + #if !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_ANDROID) + map.AddWebUIConfig(std::make_unique()); + map.AddWebUIConfig(std::make_unique()); ++ map.AddWebUIConfig(std::make_unique()); + map.AddWebUIConfig(std::make_unique()); + map.AddWebUIConfig(std::make_unique()); + map.AddWebUIConfig(std::make_unique()); +--- a/chrome/browser/chrome_browser_main.cc ++++ b/chrome/browser/chrome_browser_main.cc +@@ -1013,6 +1013,9 @@ int ChromeBrowserMainParts::PreCreateThr + if (first_run::IsChromeFirstRun()) { + if (!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kApp) && + !base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kAppId)) { ++ // TODO: make this run for every single profile that hasn't seen it yet, ++ // OR inherit preferences from the default profile ++ browser_creator_->AddFirstRunTabs({GURL("chrome://setup")}); + browser_creator_->AddFirstRunTabs(master_prefs_->new_tabs); + } + +--- /dev/null ++++ b/chrome/browser/ui/webui/onboarding/onboarding_page_ui.cc +@@ -0,0 +1,27 @@ ++// Copyright 2025 The Helium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#include "chrome/browser/ui/webui/onboarding/onboarding_page_ui.h" ++ ++#include "chrome/browser/profiles/profile.h" ++#include "chrome/common/webui_url_constants.h" ++#include "content/public/browser/web_ui_controller.h" ++#include "content/public/browser/web_ui_data_source.h" ++#include "components/helium_onboarding/resources/grit/helium_onboarding_generated.h" ++#include "components/helium_onboarding/resources/grit/helium_onboarding_generated_map.h" ++#include "ui/webui/webui_util.h" ++ ++HeliumOnboardingPage::HeliumOnboardingPage(content::WebUI* web_ui) : WebUIController(web_ui) { ++ content::WebUIDataSource* source = ++ content::WebUIDataSource::CreateAndAdd( ++ Profile::FromWebUI(web_ui), chrome::kHeliumSetupHost ++ ); ++ ++ webui::SetupWebUIDataSource( ++ source, kHeliumOnboardingGenerated, ++ IDR_HELIUM_ONBOARDING_INDEX_HTML); ++ ++ source->UseStringsJs(); ++ source->DisableTrustedTypesCSP(); ++} +--- /dev/null ++++ b/chrome/browser/ui/webui/onboarding/onboarding_page_ui.h +@@ -0,0 +1,30 @@ ++// Copyright 2025 The Helium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#ifndef CHROME_BROWSER_UI_WEBUI_ONBOARDING_ONBOARDING_PAGE_H_ ++#define CHROME_BROWSER_UI_WEBUI_ONBOARDING_ONBOARDING_PAGE_H_ ++ ++#include "chrome/common/webui_url_constants.h" ++#include "content/public/browser/webui_config.h" ++#include "content/public/browser/web_ui_controller.h" ++ ++class HeliumOnboardingPage; ++ ++class HeliumOnboardingPageConfig ++ : public content::DefaultWebUIConfig { ++ public: ++ HeliumOnboardingPageConfig() ++ : DefaultWebUIConfig(content::kChromeUIScheme, ++ chrome::kHeliumSetupHost) {} ++}; ++ ++class HeliumOnboardingPage : public content::WebUIController { ++public: ++ explicit HeliumOnboardingPage(content::WebUI* web_ui); ++ ++ HeliumOnboardingPage(const HeliumOnboardingPage&) = delete; ++ HeliumOnboardingPage& operator=(const HeliumOnboardingPage&) = delete; ++}; ++ ++#endif // CHROME_BROWSER_UI_WEBUI_ONBOARDING_ONBOARDING_PAGE_H_ diff --git a/patches/series b/patches/series index caeb5e54..90ca0274 100644 --- a/patches/series +++ b/patches/series @@ -96,7 +96,6 @@ extra/ungoogled-chromium/add-flag-for-incognito-themes.patch extra/ungoogled-chromium/add-flags-for-referrer-customization.patch extra/ungoogled-chromium/default-webrtc-ip-handling-policy.patch extra/ungoogled-chromium/add-flags-for-existing-switches.patch -extra/ungoogled-chromium/first-run-page.patch extra/ungoogled-chromium/disable-capture-all-screens.patch extra/ungoogled-chromium/add-flag-to-reduce-system-info.patch extra/ungoogled-chromium/add-flag-to-remove-client-hints.patch @@ -129,6 +128,7 @@ helium/enable-tab-muting.patch helium/disable-bookmarks-bar.patch helium/reenable-spellcheck-downloads.patch helium/prefer-https-by-default.patch +helium/onboarding-page.patch helium/settings/move-search-suggest.patch helium/settings/move-macos-settings.patch