Thorium Browser Flags

Slug: thorium

19233 characters 1185 words

#linux

#enclose flags within Thorium Binary

file:///opt/chromium.org/thorium/thorium-browser

# Allow users to override command-line options with a file. if [[ -f $XDG_CONFIG_HOME/thorium-flags.conf ]]; then CHROME_USER_FLAGS="$(cat $XDG_CONFIG_HOME/thorium-flags.conf)" fi # Append flags to CHROME_USER_FLAGS CHROME_USER_FLAGS="$CHROME_USER_FLAGS" # Sanitize std{in,out,err} because they'll be shared with untrusted child # processes (http://crbug.com/376567). exec < /dev/null exec > >(exec cat) exec 2> >(exec cat >&2) if [ $want_temp_profile -eq 1 ] ; then TEMP_PROFILE=`mktemp -d` echo "Using temporary profile: $TEMP_PROFILE" CHROME_USER_FLAGS="$CHROME_USER_FLAGS --user-data-dir=$TEMP_PROFILE" fi # Launch Thorium # Note: exec -a below is a bashism. exec -a "$0" "$HERE/thorium" --no-sandbox --disable-nacl --use-gl=angle --use-angle=gl-egl --enable-unsafe-webgpu --disable-plugins --enable-gpu-rasterization --ignore-gpu-blacklist --enable-chrome-browser-cloud-management --disable-smooth-scrolling --disable-popup-blocking --enable-fast-unload --disable-overscroll-edge-effect --disable-threaded-scrolling --disable-composited-antialiasing --flag-switches-begin --allow-insecure-downloads --allow-insecure-localhost --close-window-with-last-tab=never --hide-sidepanel-button --unsafely-treat-insecure-origin-as-secure --enable-features=VaapiVideoDecodeLinuxGL --disable-features=BlockInsecurePrivateNetworkRequests,InsecureDownloadWarnings,SideSearch --flag-switches-end "$CHROME_USER_FLAGS" "$@" # windows ## `...\thorium\thorium-flags.conf`
--allow-insecure-downloads --allow-insecure-localhost --allow-outdated-plugins --cast-streaming-force-enable-hardware-h264 --cast-streaming-force-enable-hardware-vp8 --cast-streaming-force-enable-hardware-vp9 --classic-omnibox --close-window-with-last-tab=never --disable-breakpad --disable-composited-antialiasing --disable-encryption --disable-logging --disable-machine-id --disable-overscroll-edge-effect --disable-popup-blocking --disable-smooth-scrolling --disable-thorium-icons --disable-threaded-scrolling --enable-chrome-browser-cloud-management --enable-download-warning-improvements --enable-fast-unload --enable-gpu-rasterization --enable-quic --enable-unsafe-webgpu --force-ntp-mobile-promo --hide-sidepanel-button --ignore-gpu-blocklist --keep-all-history --left-aligned-tab-search-button --ozone-platform-hint=auto --show-component-extension-options --unsafely-treat-insecure-origin-as-secure --use-angle=d3d11 --use-gl=angle --enable-features=EnableUnsafeWebGPU,AllowAllSitesToInitiateMirroring,CastAllowAllIPs,CastStreamingAv1,CastStreamingVp8,CastStreamingVp9,CastStreamingWinHardwareH264,ShowCastPermissionRejectedError,VaapiVideoDecodeLinuxGL,ExtensionsMenuAccessControl,FluentOverlayScrollbar,GlobalMediaControlsUpdatedUI,LensEnableImageTranslate,LensOverlay,LensStandalone,MediaRouter,NTPRealboxContextualAndTrendingSuggestions,NtpRealboxMatchSearchboxTheme,NtpRealboxPedals,NtpRealboxUseGoogleGIcon,OverlayScrollbar,PrivateNetworkAccessPermissionPrompt,StarterPackExpansion,TabGroupsSaveUIUpdate,Thorium2024,ToolbarPinning,UnexpireFlagsM126,UnexpireFlagsM127,BuiltInHlsPlayer,CameraMicEffects,CameraMicPreview,DesktopScreenshots,GlobalMediaControlsCastStartStop,OneTimePermission,PageInfoHistoryDesktop,ParallelDownloading,UnexpireFlagsM122,UnexpireFlagsM123,UnexpireFlagsM129,UnexpireFlagsM130,Vulkan,AiSettingsPageRefresh,ChromeLabs:chrome_labs_activation_percentage/100,CompactMode,CustomizeChromeSidePanelExtensionsCard,CustomizeChromeWallpaperSearch,CustomizeChromeWallpaperSearchButton,CustomizeChromeWallpaperSearchInspirationCard,DataSharing,DevToolsPrivacyUI,EnableAIPromptAPIForWebPlatform,EnableAIRewriterAPI,EnableAISummarizationAPI,EnableAIWriterAPI,FluentScrollbar,ImprovedSigninUIOnDesktop,LensOverlay:omnibox-entry-point/true/omnibox-entry-point-always-visible/true,LensOverlayContextualSearchbox:use-pdfs-as-context/true,LensOverlayImageContextMenuActions:enable-copy-as-image/true/enable-save-as-image/true,LensOverlayTranslateButton,LinkPreview:trigger_type/alt_click,LiveCaptionMultiLanguage,MultiTabOrganization,NtpCalendarModule:NtpCalendarModuleDataParam/fake,NtpMobilePromo,NtpModulesRedesigned,NtpOutlookCalendarModule:NtpOutlookCalendarModuleDataParam/fake,NtpSharepointModule,NtpWallpaperSearchButton,NtpWallpaperSearchButtonAnimation,PdfCr23,PermissionPredictionsV3,ResponsiveToolbar,ShowRelatedWebsiteSetsPermissionGrants,SidePanelResizing,SupportTool,SupportToolScreenshot,TabOrganization,TabOrganizationSettingsVisibility,TabReorganization,TabReorganizationDivider,TabstripDeclutter,TaskManagerDesktopRefresh,ToastFramework,TranslateOpenSettings,VideoPictureInPictureControlsUpdate2024 --disable-features=BlockInsecurePrivateNetworkRequests,InsecureDownloadWarnings,SideSearch,ChromeRefresh2023,ChromeRefresh2023NTB,ChromeRefresh2023TopChromeFont,ChromeWebuiRefresh2023,Cr2023ActionChips,Cr2023ActionChipsIcons,CustomizeChromeColorExtraction,CustomizeChromeSidePanel,FtpProtocol,OmniboxExpandedLayout,OmniboxExpandedStateColors,OmniboxExpandedStateHeight,OmniboxExpandedStateShape,OmniboxExpandedStateSuggestIcons,OmniboxSteadyStateBackgroundColor,OmniboxSteadyStateHeight,OmniboxSteadyStateTextColor,OmniboxSteadyStateTextStyle,OmniboxSuggestionHoverFillShape,PageInfoHideSiteSettings,PowerBookmarkBackend,SystemNotifications,kOmniboxCR23SteadyStateIcons ## `...\thorium\thorium.ps1`
<# .SYNOPSIS Launches the Thorium Browser on Windows 11 using a portable installation with hardcoded paths. .DESCRIPTION This script is designed for a portable Thorium Browser installation located at "G:\05-portable\thorium". It uses the BIN folder to locate the executable (thorium.exe) and the persistent user data folder is hardcoded to "G:\05-portable\thorium\USER_DATA". Additionally, any extra flags are read from the configuration file located at "G:\05-portable\thorium\thorium-flags.conf". It also supports creation of a temporary profile when the -TempProfile switch is used. .PARAMETER TempProfile If specified, a temporary user data directory will be created instead of using the default USER_DATA folder. .PARAMETER AdditionalArgs Allows passing additional command-line arguments to the Thorium executable. #> param( [switch]$TempProfile, [Parameter(ValueFromRemainingArguments = $true)] [string[]]$AdditionalArgs ) #-------------------------------------------------------------------- # Set the base directory for the portable Thorium installation. $thoriumBasePath = "G:\05-portable\thorium" # Define expected paths from the portable installation structure. $thoriumExecutable = Join-Path -Path $thoriumBasePath -ChildPath "BIN\thorium.exe" $defaultUserData = Join-Path -Path $thoriumBasePath -ChildPath "USER_DATA" # Hardcode the configuration file path to the portable directory. $configFile = Join-Path -Path $thoriumBasePath -ChildPath "thorium-flags.conf" # Validate the existence of the Thorium executable. if (-not (Test-Path $thoriumExecutable)) { throw "Thorium executable not found at: $thoriumExecutable. Please verify your portable installation." } #-------------------------------------------------------------------- # Load additional flags from the hardcoded configuration file. $userFlags = @() if (Test-Path $configFile -ErrorAction SilentlyContinue) { try { $fileContent = Get-Content $configFile -ErrorAction Stop foreach ($line in $fileContent) { if ($line.Trim() -match "^\s*--") { $userFlags += $line.Trim() } } } catch { Write-Warning "Failed to read configuration file at ${configFile}: $_" } } #-------------------------------------------------------------------- # Determine the user data directory. # If -TempProfile is specified, create a temporary directory; otherwise, use the hardcoded USER_DATA folder. if ($TempProfile) { $tempProfilePath = Join-Path $env:TEMP ("ThoriumProfile_" + [guid]::NewGuid().ToString()) try { New-Item -Path $tempProfilePath -ItemType Directory -ErrorAction Stop | Out-Null Write-Host "Using temporary profile directory: $tempProfilePath" # Quote the path in case it contains spaces. $userFlags += "--user-data-dir=`"$tempProfilePath`"" } catch { Write-Warning "Failed to create temporary profile directory: $_" exit 1 } } else { if (Test-Path $defaultUserData) { $userFlags += "--user-data-dir=`"$defaultUserData`"" } else { Write-Warning "Default user data folder not found at: $defaultUserData" } } #-------------------------------------------------------------------- # Define default flags suitable for Windows. $defaultFlags = @( "--no-sandbox" ) #-------------------------------------------------------------------- # Aggregate all arguments: default flags, flags from the config file, and any additional arguments. $arguments = $defaultFlags + $userFlags + $AdditionalArgs #-------------------------------------------------------------------- # Launch the Thorium Browser using Start-Process. try { Write-Host "Launching Thorium from: $thoriumExecutable" Write-Host "With arguments: $arguments" Start-Process -FilePath $thoriumExecutable -ArgumentList $arguments -NoNewWindow } catch { Write-Error "Failed to launch Thorium: $_" exit 1 } ## `...\b.bat"` ``` @echo off pushd "G:\05-portable\thorium" start "" "C:\Program Files\PowerShell\7\pwsh.exe" -NoProfile -ExecutionPolicy Bypass -File "thorium.ps1" exit ```
URL: https://ib.bsb.br/thorium