diff --git a/patches/extra/ungoogled-chromium/first-run-page.patch b/patches/extra/ungoogled-chromium/first-run-page.patch new file mode 100644 index 0000000000..1f8e49d6f6 --- /dev/null +++ b/patches/extra/ungoogled-chromium/first-run-page.patch @@ -0,0 +1,182 @@ +--- a/chrome/browser/chrome_browser_main.cc ++++ b/chrome/browser/chrome_browser_main.cc +@@ -988,6 +988,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_controller_factory.cc ++++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc +@@ -65,6 +65,7 @@ + #include "chrome/browser/ui/webui/suggest_internals/suggest_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" +@@ -1269,6 +1270,8 @@ WebUIFactoryFunction GetWebUIFactoryFunc + } + #endif + ++ if (url.host() == "ungoogled-first-run") return &NewWebUI; ++ + return nullptr; + } + +--- /dev/null ++++ b/chrome/browser/ui/webui/ungoogled_first_run.h +@@ -0,0 +1,140 @@ ++#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 "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 bellow to see what information 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.
++
Keep login and session data
++ By default ungoogled-chromium has Clear cookies and site data when you close all windows enabled.
++ This option can be changed in ++ ++ chrome://settings/cookies.
++
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 : 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 +@@ -667,6 +667,7 @@ const char kExtensionConfigureCommandsSu + // Add hosts here to be included in chrome://chrome-urls (about:about). + // These hosts will also be suggested by BuiltinProvider. + const char* const kChromeHostURLs[] = { ++ "ungoogled-first-run", + kChromeUIAboutHost, + kChromeUIAccessibilityHost, + #if !BUILDFLAG(IS_ANDROID) diff --git a/patches/series b/patches/series index 0af7ec7e32..fabe37dd7e 100644 --- a/patches/series +++ b/patches/series @@ -99,3 +99,4 @@ extra/ungoogled-chromium/add-flag-to-hide-extensions-menu.patch extra/ungoogled-chromium/add-flag-to-hide-fullscreen-exit-ui.patch extra/ungoogled-chromium/add-flag-for-incognito-themes.patch extra/ungoogled-chromium/add-flags-for-referrer-customization.patch +extra/ungoogled-chromium/first-run-page.patch