-
-
Notifications
You must be signed in to change notification settings - Fork 20
feat(ui): add Trivalent FAQ page #591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
2f78b81
feat(ui): add Trivalent FAQ page
RKNF404 c3a992e
Update trivalent-faq-page.patch
RKNF404 61fa586
Update trivalent-faq-page.patch
RKNF404 d9aa668
Update trivalent-faq-page.patch
RKNF404 af165e0
Update trivalent-faq-page.patch
RKNF404 fb3b14a
Update trivalent-faq-page.patch
RKNF404 993ce9e
Update add-license-info.patch
RKNF404 e53c237
Update trivalent-faq-page.patch
RKNF404 6cfcf09
Merge branch 'live' into faq-page
RoyalOughtness 9d7944c
Update trivalent-faq-page.patch
RKNF404 1bb592f
fix: syntax error
RKNF404 36a1bca
Update add-license-info.patch
RKNF404 fce5e05
Update trivalent-faq-page.patch
RKNF404 9bf9c5b
Update trivalent-faq-page.patch
RKNF404 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,296 @@ | ||
| Copyright (c) 2015-2025, The ungoogled-chromium Authors | ||
| Copyright (c) 2026, The Trivalent Authors | ||
| All rights reserved. | ||
|
|
||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions are met: | ||
|
|
||
| 1. Redistributions of source code must retain the above copyright notice, this | ||
| list of conditions and the following disclaimer. | ||
|
|
||
| 2. Redistributions in binary form must reproduce the above copyright notice, | ||
| this list of conditions and the following disclaimer in the documentation | ||
| and/or other materials provided with the distribution. | ||
|
|
||
| 3. Neither the name of the copyright holder nor the names of its | ||
| contributors may be used to endorse or promote products derived from | ||
| this software without specific prior written permission. | ||
|
|
||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
| FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
| SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
| CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
| OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| --- | ||
| diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc | ||
| index d347c428ac..29faea895d 100644 | ||
| --- a/chrome/browser/chrome_browser_main.cc | ||
| +++ b/chrome/browser/chrome_browser_main.cc | ||
| @@ -1214,6 +1214,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { | ||
| if (first_run::IsChromeFirstRun()) { | ||
| if (!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kApp) && | ||
| !base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kAppId)) { | ||
| + browser_creator_->AddFirstRunTabs({GURL("chrome://trivalent-faq")}); | ||
| browser_creator_->AddFirstRunTabs(master_prefs_->new_tabs); | ||
| } | ||
| } | ||
| diff --git a/chrome/browser/ui/webui/chrome_web_ui_configs.cc b/chrome/browser/ui/webui/chrome_web_ui_configs.cc | ||
| index d185bfdfbb..7e66f32eb3 100644 | ||
| --- a/chrome/browser/ui/webui/chrome_web_ui_configs.cc | ||
| +++ b/chrome/browser/ui/webui/chrome_web_ui_configs.cc | ||
| @@ -48,6 +48,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/trivalent_faq.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" | ||
| @@ -274,6 +275,7 @@ void RegisterChromeWebUIConfigs() { | ||
| map.AddWebUIConfig(std::make_unique<SiteEngagementUIConfig>()); | ||
| map.AddWebUIConfig(std::make_unique<SyncInternalsUIConfig>()); | ||
| map.AddWebUIConfig(std::make_unique<TranslateInternalsUIConfig>()); | ||
| + map.AddWebUIConfig(std::make_unique<TrivalentFAQUIConfig>()); | ||
| map.AddWebUIConfig(std::make_unique<UsbInternalsUIConfig>()); | ||
| map.AddWebUIConfig(std::make_unique<UserActionsUIConfig>()); | ||
| map.AddWebUIConfig(std::make_unique<VersionUIConfig>()); | ||
| diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_constants.cc | ||
| index f96fccfbc2..a058283fb5 100644 | ||
| --- a/chrome/common/webui_url_constants.cc | ||
| +++ b/chrome/common/webui_url_constants.cc | ||
| @@ -74,6 +74,7 @@ bool IsSystemWebUIHost(std::string_view host) { | ||
| // These hosts will also be suggested by BuiltinProvider. | ||
| base::span<const base::cstring_view> ChromeURLHosts() { | ||
| static constexpr auto kChromeURLHosts = std::to_array<base::cstring_view>({ | ||
| + "trivalent-faq", | ||
| kChromeUIAboutHost, | ||
| kChromeUIAccessibilityHost, | ||
| kChromeUIActorInternalsHost, | ||
| diff --git a/chrome/browser/ui/webui/trivalent_faq.h b/chrome/browser/ui/webui/trivalent_faq.h | ||
| new file mode 100644 | ||
| --- /dev/null | ||
| +++ b/chrome/browser/ui/webui/trivalent_faq.h | ||
| @@ -0,0 +1,218 @@ | ||
| +#ifndef CHROME_BROWSER_UI_WEBUI_TRIVALENT_FAQ_H_ | ||
| +#define CHROME_BROWSER_UI_WEBUI_TRIVALENT_FAQ_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 TFDataSource : public content::URLDataSource { | ||
| + public: | ||
| + TFDataSource() {} | ||
| + TFDataSource(const TFDataSource&) = delete; | ||
| + TFDataSource& operator=(const TFDataSource&) = delete; | ||
| + std::string GetSource() { return "trivalent-faq"; } | ||
| + std::string GetMimeType(const GURL& url) { return "text/html"; } | ||
| + bool IsWebUIEnabled(content::BrowserContext* browser_context) { | ||
| + return !Profile::FromBrowserContext(browser_context)->IsOffTheRecord(); | ||
| + } | ||
| + std::string GetContentSecurityPolicy(network::mojom::CSPDirectiveName directive) { | ||
| + if (directive == network::mojom::CSPDirectiveName::DefaultSrc) | ||
| + return "default-src 'none';"; | ||
| + else if (directive == network::mojom::CSPDirectiveName::StyleSrc) | ||
| + return "style-src-elem chrome: 'unsafe-inline';"; | ||
| + else if (directive == network::mojom::CSPDirectiveName::FontSrc) | ||
| + return "font-src chrome:;"; | ||
| + else if (directive == network::mojom::CSPDirectiveName::FormAction) | ||
| + return "form-action 'none';"; | ||
| + else if (directive == network::mojom::CSPDirectiveName::FrameAncestors) | ||
| + return "frame-ancestors 'none';"; | ||
| + else if (directive == network::mojom::CSPDirectiveName::BaseURI) | ||
| + return "base-uri 'none';"; | ||
| + else if (directive == network::mojom::CSPDirectiveName::Sandbox) | ||
| + return "sandbox;"; | ||
| + else if (directive == network::mojom::CSPDirectiveName::UpgradeInsecureRequests) | ||
| + return "upgrade-insecure-requests;"; | ||
| + return std::string(); | ||
| + } | ||
| + void StartDataRequest(const GURL& url, | ||
| + const content::WebContents::Getter& wc_getter, | ||
| + GotDataCallback callback) { | ||
| + std::string source = R"( | ||
| +<title>Trivalent FAQ</title> | ||
| +<meta name="color-scheme" content="light dark"> | ||
| +<style> | ||
| + @import url(//resources/css/text_defaults_md.css); | ||
| + html { | ||
| + color: #202124; | ||
| + background: white; | ||
| + line-height: 1.1em | ||
| + } | ||
| + a { | ||
| + color: #1967d2 | ||
| + } | ||
| + h2, h3 { | ||
| + margin: 0; | ||
| + padding: 0.67em 1.33em | ||
| + } | ||
| + p, details { | ||
| + border-top: .063em solid #f0f0f0; | ||
| + margin: 0; | ||
| + padding: 1em 2em; | ||
| + line-height: 110% | ||
| + } | ||
| + ul, ol { | ||
| + padding-left: 2em | ||
| + } | ||
| + code { | ||
| + background: rgba(128 128 128 / .2); | ||
| + padding: 0 0.5em; | ||
| + border-radius: 0.25em | ||
| + } | ||
| + summary { | ||
| + cursor: pointer | ||
| + } | ||
| + section { | ||
| + width: 60em; | ||
| + margin: 4em auto; | ||
| + border-radius: .5em; | ||
| + background: white; | ||
| + box-shadow: 0 .063em .125em 0 #c4c5c6, 0 .125em .375em .125em #e2e3e3 | ||
| + } | ||
| + @media(prefers-color-scheme:dark) { | ||
| + html { | ||
| + color: #e8eaed; | ||
| + background: #202124 | ||
| + } | ||
| + a { | ||
| + color: #8ab4f8 | ||
| + } | ||
| + p, details { | ||
| + border-top: .063em solid #3f4042 | ||
| + } | ||
| + section { | ||
| + background: #292a2d; | ||
| + box-shadow: 0 .063em .125em 0 #161719, 0 .125em .375em .125em #1b1c1f | ||
| + } | ||
| + } | ||
| +</style> | ||
| +<base target="_blank"> | ||
| +<section> | ||
| + <h2>Trivalent</h2><p> | ||
| + Trivalent is a security-focused, Chromium-based browser for desktop Linux inspired by | ||
| + <a href="https://github.com/GrapheneOS/Vanadium">Vanadium</a>. | ||
| + <p> | ||
| + This page can always be accessed from <a href="chrome://trivalent-faq">chrome://trivalent-faq</a> | ||
| +</section> | ||
| +<section> | ||
| + <h2>Additional Preferences</h2><p> | ||
| + Some of the features Trivalent provides can be controlled via preferences. | ||
| + These preferences can be accessed in the <a href="chrome://settings/security">security settings</a> | ||
| + in the section titled <code>Hardening</code> at the bottom. | ||
| + Some additional preferences are also added for convenience, such as a website dark mode toggle in | ||
| + <a href="chrome://settings/appearance">appearance settings</a>. | ||
| +</section> | ||
| +<section> | ||
| + <h2>FAQ</h2> | ||
| + <details><summary><b>Which filters are included in Trivalent adblocking? How do I add a new filter?</b></summary><br> | ||
| + Trivalent comes preloaded with EasyList, EasyPrivacy, Fanboy Annoyance, and a wide set of | ||
| + regional filter lists covering Europe, Asia, the Middle East, and more. It also includes | ||
| + Anti-Adblock Filters to bypass detection. You can see the full list here: | ||
| + <a href="https://github.com/secureblue/trivalent-subresource-filter/blob/live/copr_script.sh">Trivalent filter sources</a>. | ||
| + Since these filters are precompiled at build time, if you want to add a new filter, please open an issue or submit a pull | ||
| + request in the same repository. | ||
| + </details> | ||
| + <details><summary><b>Why aren't YouTube ads blocked, and how can I watch YouTube without ads?</b></summary><br> | ||
| + Trivalent's subresource filter cannot perform script injection or observe and alter what happens | ||
| + inside YouTube's video player, so it can't reliably intercept the scripts and dynamic behavior | ||
| + YouTube uses to serve ads. To avoid ads, you need a tool capable of doing that. Common options | ||
| + are <a href="https://flathub.org/apps/io.freetubeapp.FreeTube">FreeTube Electron Flatpak</a>, | ||
| + <a href="https://flathub.org/apps/de.schmidhuberj.tubefeeder">Pipeline Piped proxy Flatpak</a>, | ||
| + and the YouTube PWA (progressive web-app) paired with uBlock Origin Lite. Consider creating a | ||
| + separate profile for the Youtube PWA, so you can continue browsing extensionless for your | ||
RKNF404 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| + usual profile.<br> | ||
| + To install a PWA, click the <code>Install</code> button in the address bar, or at the top right, | ||
| + click the three dots, then </code>Save and Share -> Install page as app</code>. | ||
| + </details> | ||
| + <details><summary><b>Why does Trivalent log me out of all sites by default?</b></summary><br> | ||
| + It shouldn't, but this is a bug related to Chromium's Network Service Sandbox where cookies are | ||
| + either cleared or become inaccessible when the browser is closed. If you experience this, | ||
| + navigate to <a href="chrome://settings/security">security settings</a>, at the bottom you will | ||
| + see a <code>Hardening</code> section and within it a toggle <code>Network Service Sandbox</code>, | ||
| + flip this to off and restarting your browser. | ||
| + <br><br> | ||
| + Please note that the <code>Network Service Sandbox</code> is no longer enabled by default. Users | ||
| + should keep in mind that enabling this setting may result in issues with cookie persistence. | ||
| + Also note that this is a global toggle, which means that all of your browser profiles will be | ||
| + affected if the setting is toggled. | ||
| + </details> | ||
| + <details><summary><b>Why don't extensions work in Trivalent?</b></summary><br> | ||
| + Extensions in Trivalent are disabled by default, for security reasons, it is not advised to | ||
| + use them. If you want content/ad blocking, that is already built into Trivalent and enabled by | ||
| + default. If you require extensions, you can re-enable them by disabling the | ||
| + <code>Disable Extensions</code> toggle under | ||
| + <a href="chrome://settings/security">chrome://settings/security</a>, then restarting your browser | ||
| + (this toggle is per-profile). | ||
| + <br><br> | ||
| + If the extension you installed doesn't work, it may be because it requires JavaScript | ||
| + Just-In-Time Compilation (JIT), which is disabled by default in Trivalent. To re-enable JavaScript JIT | ||
| + for an extension, visit <a href="chrome://extensions">chrome://extensions</a>, under the extension with the issues, go | ||
| + <code>Details -> Site Settings</code>, then scroll to | ||
| + <code>JavaScript Optimization & Security</code> and flip to allow. | ||
| + If the extension continues to not work, try reinstalling the extension. | ||
| + </details> | ||
| + <details><summary><b>Why don't some websites that require JIT/WebAssembly work in Trivalent even with the JavaScript Optimizations toggle enabled?</b></summary><br> | ||
| + This is an upstream bug that prevents JavaScript Optimization settings from being applied to | ||
| + iframes embedded within a parent website. As a result, WebAssembly may not function on services | ||
| + that use a separate URL for their content delivery network or other included domains, such as | ||
| + VSCode Web (<code>https://github.dev</code>). To make VSCode Web work properly, you need to | ||
| + manually allow JavaScript optimizations for the CDN by adding | ||
| + <code>https://[*.]vscode-cdn.net</code> to your list of trusted websites. | ||
| + <br><br> | ||
| + There is also currently a bug where the Optimizations permission doesn't apply to a tab even | ||
| + after reloading, only after closing and re-opening the tab does the optimizations toggle | ||
| + properly apply. | ||
| + </details> | ||
| + <details><summary><b>Why doesn't DRM content (Spotify, Netflix etc.) work in Trivalent by default?</b></summary><br> | ||
| + DRM-protected content is available in Trivalent, however it is disabled by default. Visit | ||
| + <a href="chrome://settings/content/protectedContent">chrome://settings/content/protectedContent</a> | ||
| + and select <code>Sites can play protected content</code>. | ||
| + </details> | ||
| +</section> | ||
| +<section> | ||
| + <h2>Additional Feature Toggles</h2><p> | ||
| + Trivalent introduces some extra flags and features that can be viewed at | ||
| + <a href="chrome://flags">chrome://flags</a>. The default state of each flag/feature | ||
| + is explained in it's respective description. Some are features already present in chromium, | ||
| + just exposed, and some are Trivalent-provided features. Both of these are labeled as such. | ||
| +</section> | ||
| +<section> | ||
| + <h2>Additional Links</h2><p> | ||
| + Read the secureblue <a href="https://secureblue.dev/#faq">FAQ</a>. | ||
| + <p> | ||
| + Consider contributing to <a href="https://github.com/secureblue/Trivalent">Trivalent</a> and <a href="https://github.com/secureblue/secureblue">secureblue</a>. | ||
| +</section> | ||
| +)"; | ||
| + std::move(callback).Run(base::MakeRefCounted<base::RefCountedString>(std::move(source))); | ||
| + } | ||
| +}; | ||
| + | ||
| +class TrivalentFAQ; | ||
| +class TrivalentFAQUIConfig : public content::DefaultWebUIConfig<TrivalentFAQ> { | ||
| + public: | ||
| + TrivalentFAQUIConfig() : DefaultWebUIConfig("chrome", "trivalent-faq") {} | ||
| +}; | ||
| + | ||
| +class TrivalentFAQ : public content::WebUIController { | ||
| + public: | ||
| + TrivalentFAQ(content::WebUI* web_ui) : content::WebUIController(web_ui) { | ||
| + content::URLDataSource::Add(Profile::FromWebUI(web_ui), std::make_unique<TFDataSource>()); | ||
| + } | ||
| + TrivalentFAQ(const TrivalentFAQ&) = delete; | ||
| + TrivalentFAQ& operator=(const TrivalentFAQ&) = delete; | ||
| +}; | ||
| + | ||
| +#endif // CHROME_BROWSER_UI_WEBUI_TRIVALENT_FAQ_H_ | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.