Chromium 浏览器便携化启动工具

Chromium 浏览器便携化启动工具

December 21, 2023
分享 , 工具箱 , Chromium ,

Edge 广告泛滥

前些日子听朋友吐槽 Edge 浏览器最近的更新可谓是如何如何不当人,经常刷到的新闻也都是说强制弹广告、升级之类的负面新闻,刚出来的那个大家都喜欢的、如白纸般的 Edge 早已经不复存在了,如今的人们可谓是苦 Edge 久矣。

当然,这种情况自然是不能惯着,找替代品,必须找替代品给他替代了。

不过第三方 Chromium 换皮浏览器如今可是太多太多了,比如我就在使用的国产百分浏览器,虽然百分浏览器 2022 年 12 月奇迹般的更新了一次,但是时隔一年又归于沉寂,内核还依旧停留在 Chromium 102.0.5005.167 ,过旧的内核导致了一些前端框架特性、新浏览器特性无法使用,但是目前国内其他毒瘤大厂各种魔改的浏览器我又不想使用,所以又花了一番心思寻找。

去花里胡哨 Chromium 版本

最终,我在 Github 找到了 Hibbiki 修改的 Chromium-win64 ,去掉了一些花里胡哨的功能,且有「含 Google 服务版本」和「无 Google 服务版本」,最大程度上把选择权交给用户。

💡
另外一个版本是 winchrome 大佬的 Chromium ungoogled 版本,但是 V2ex 上有人说这个版本会有兼容问题,不建议使用,请自行测试。

但是默认情况下 Chromium 启动后数据会存放在系统用户文件夹中,这样偶尔重装系统如果不注意可能会出现数据丢失的情况,当然你可以通过创建快捷方式,并附带启动命令指定用户目录解决这个问题:

chrome.exe --disable-encryption --disable-machine-id --user-data-dir="目录"

Chromium 启动器

但是这样操作更新会比较麻烦,所以我在 Github 上找到了 Chrlauncher ,这是一款小巧、便携的 Chromium 启动、更新工具,具有以下特性:

  • 开源:https://github.com/henrypp/chrlauncher
  • 浏览器下载:支持多个 Github 上热门的 Chromium 浏览器,通过配置文件可以十分方便的切换浏览器版本(目前支持了 7 种 Chromium 修改版本)。
  • 更新:支持自动检测目前浏览器是否有更新,自动下载。
  • 便携化启动:可以自定义浏览器用户文件夹,便携启动。

使用方法

Release 页面下载适用于自己系统版本的 Chrlauncher,解压在任意目录后打开 Chrlauncher 目录内 8664 文件夹内的配置文件 chrlauncher.ini ,配置内容如下:

[chrlauncher]

# Custom Chromium update URL (string):
#ChromiumUpdateUrl=https://chromium.woolyss.com/api/v3/?os=windows&bit=%d&type=%s&out=string

# Chromium启动命令 / Command line for Chromium (string):
# See here: https://peter.sh/experiments/chromium-command-line-switches/
ChromiumCommandLine=--flag-switches-begin --user-data-dir=..\profile --no-default-browser-check --flag-switches-end

# 自定义Chromium可执行文件位置 / Chromium executable file name (string):
ChromiumBinary=chrome.exe

# 自定义Chromium程序目录 / Chromium binaries directory (string):
# Relative (to chrlauncher directory) or full path (env. variables supported).
ChromiumDirectory=.\bin

# Set Chromium binaries architecture (integer):
#
# 0		-> 	autodetect (default)
# 64	-> 64-bit
# 32	-> 32-bit
ChromiumArchitecture=0

# Auto download updates if found (boolean)
#
# false	-> show tray tip if update found, downloading manually (default)
# true	-> auto download update and install it!
ChromiumAutoDownload=false

# Bring chrlauncher window when download started (boolean)
#
# false	-> don't bring main window to front automatically
# true	-> bring chrlauncher window to front when download started (default)
ChromiumBringToFront=true

# Set download in foreground mode (boolean):
#
# false	-> start browser and check/download/install update in background
# true	-> start browser only when check/download/install update complete (default)
ChromiumWaitForDownloadEnd=true

# Use chrlauncher as updater, but does not start Chromium (boolean):
#
# false	-> update & start Chromium (default)
# true	-> download & install Chromium update without start
ChromiumUpdateOnly=false

# 支持的Chromium版本 / Type of Chromium builds:
#
# dev-official
#	Official development builds from snapshots repository
#	"storage.googleapis.com/chromium-browser-snapshots/index.html" (32/64 bit)
#
# stable-codecs-sync
#	Unofficial stable builds with codecs
#	"github.com/Hibbiki/chromium-win64/releases" (64 bit)
#	"github.com/Hibbiki/chromium-win32/releases" (32 bit)
#
# dev-nosync
#	Unofficial development builds without Google services
#	"github.com/RobRich999/Chromium_Clang/releases" (32/64 bit)
#
# dev-codecs-sync
#	Unofficial development builds with codecs and without Google services
#	"github.com/macchrome/winchrome/releases" (64 bit)
#
# dev-codecs-nosync
#	Unofficial development builds with codecs and without Google services
#	"github.com/macchrome/winchrome/releases" (64 bit)
#
# ungoogled-chromium
#	Unofficial builds without Google integration and enhanced privacy (based on Eloston project)
#	"github.com/macchrome/winchrome/releases/" (32/64 bit)
#	"github.com/Eloston/ungoogled-chromium"
#
# stable-codecs-nosync
#	Unofficial stable builds with codecs and without google services
#	!!! DISCONTINUED since June 2018 !!!
ChromiumType=stable-codecs-sync

# 更新检测频率 / Check for new Chromium version once in X days (integer):
#
# 2	-> check updates once in a X days (default)
# 0	-> disable update checking
# -1	-> force update checking
ChromiumCheckPeriod=2

# Last cached update checking timestamp (integer):
ChromiumLastCheck=1703065267

#
# Internal settings (SDK)
#

# 自定义UserAgent / Set custom useragent (string):
#UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.0.0 Safari/537.36
[chrlauncher\window]
Position=1086,530

其中 79 行设置你要使用的 Chromium 版本,支持 7 种 Github 上的开源版本。当然你也可以设置 8 行、11 行、15 行,使用自己电脑内的 Chrome,并自定义启动命令。

如无特殊要求,更改 ChromiumType 为想要使用的开源版本后,执行配置文件同目录下chrlauncher.exe 程序即可自动下载设置好的 Chromium 版本,且浏览器会自动安装在同目录下bin 文件夹内,且启动完成会在同目录下生成用户资料文件夹 profile

实际使用后续

用 Chromium 可能会出现通过一些程序内的链接打开浏览器用户资文件夹不是设定的便携目录的问题,找了好久没找到办法,后来自己尝试修改注册表后解决。

在下方的注册表下的字符串项后面手动增加便携版命令参数 `--flag-switches-begin --user-data-dir=..\profile --no-default-browser-check --flag-switches-end`

计算机\HKEY_CURRENT_USER\Software\Classes\ChromiumHTM.7QEHAGLP7GW63LKM5QDXMV22BY\shell\open\command

任务栏上固定的图标可能也出现同样的情况,需要找到下面这个文件夹,把这个里面 Chrome 的快捷方式屁股后面加上上面提到的参数即可。

C:\Users\yourname\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
💡
如果你是直接对已运行的 Chrome 右键并固定到任务栏,快捷方式的路径可能会有所不同,类似这种结构:C:\Users\username\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\ImplicitAppShortcuts\9a5b0c498ff19be8 你可能需要在 ImplicitAppShortcuts 下的序号文件夹里找一找。

Enjoy!😊

加入评论