我不懂 C++,最近在摸索着改 shuax 的https://github.com/shuax/chrome_plus
,在里面增加一个--load-extension
,该参数的值已经获取成功,可是却遇到一个奇怪的现象,不会调试,所以也不知道是什么错误,请大家帮忙看看
如上图是写 log 的位置
3 个扩展,chrome 正常启动
[chrome++]extList: --load-extension="D:\SynologyDrive\Chrome\Extensions\ablbagjepecncofimgjmdpnhnfjiecfm\0.7.2_0,D:\SynologyDrive\Chrome\Extensions\dmkamcknogkgcdfhhbddcghachkejeap\0.10.5_0,D:\SynologyDrive\Chrome\Extensions\nkbihfbeogaeaoehlefnkodbefgpgknn\10.14.6_0"
[chrome++]JoinArgsString: "--profile-directory=Profile 2" --shuax --disable-quic --disable-features=RendererCodeIntegrity,FlashDeprecationWarning,SidePanel --disk-cache-dir=D:\SynologyDrive\Chrome\Cache --user-data-dir=D:\SynologyDrive\Chrome\Data --load-extension="D:\SynologyDrive\Chrome\Extensions\ablbagjepecncofimgjmdpnhnfjiecfm\0.7.2_0,D:\SynologyDrive\Chrome\Extensions\dmkamcknogkgcdfhhbddcghachkejeap\0.10.5_0,D:\SynologyDrive\Chrome\Extensions\nkbihfbeogaeaoehlefnkodbefgpgknn\10.14.6_0"
[chrome++]args: "--profile-directory=Profile 2" --shuax --disable-quic --disable-features=RendererCodeIntegrity,FlashDeprecationWarning,SidePanel --disk-cache-dir=D:\SynologyDrive\Chrome\Cache --user-data-dir=D:\SynologyDrive\Chrome\Data --load-extension="D:\SynologyDrive\Chrome\Extensions\ablbagjepecncofimgjmdpnhnfjiecfm\0.7.2_0,D:\SynologyDrive\Chrome\Extensions\dmkamcknogkgcdfhhbddcghachkejeap\0.10.5_0,D:\SynologyDrive\Chrome\Extensions\nkbihfbeogaeaoehlefnkodbefgpgknn\10.14.6_0"
4 个以上扩展时,chrome 启动失败
args:
这行 log 没有,似乎是std::wstring args = GetCommand(param);
错误了
[chrome++]extList: --load-extension="D:\SynologyDrive\Chrome\Extensions\ablbagjepecncofimgjmdpnhnfjiecfm\0.7.2_0,D:\SynologyDrive\Chrome\Extensions\dmkamcknogkgcdfhhbddcghachkejeap\0.10.5_0,D:\SynologyDrive\Chrome\Extensions\nkbihfbeogaeaoehlefnkodbefgpgknn\10.14.6_0,D:\SynologyDrive\Chrome\Extensions\padekgcemlokbadohgkifijomclgjgif\2.5.21_0"
[chrome++]JoinArgsString: "--profile-directory=Profile 2" --shuax --disable-quic --disable-features=RendererCodeIntegrity,FlashDeprecationWarning,SidePanel --disk-cache-dir=D:\SynologyDrive\Chrome\Cache --user-data-dir=D:\SynologyDrive\Chrome\Data --load-extension="D:\SynologyDrive\Chrome\Extensions\ablbagjepecncofimgjmdpnhnfjiecfm\0.7.2_0,D:\SynologyDrive\Chrome\Extensions\dmkamcknogkgcdfhhbddcghachkejeap\0.10.5_0,D:\SynologyDrive\Chrome\Extensions\nkbihfbeogaeaoehlefnkodbefgpgknn\10.14.6_0,D:\SynologyDrive\Chrome\Extensions\padekgcemlokbadohgkifijomclgjgif\2.5.21_0"
3
shuax 2022-06-16 17:44:55 +08:00
应该不用加\"吧,好像是自动加的。
|
4
shuax 2022-06-16 17:47:43 +08:00
4 个的话,应该缓冲区不够了。MAX_PATH 是 260
|
5
klgd OP @shuax #3 嗯 双引号应该是不用
你说的这里的 MAX_PATH 吗?我看 temp 在完整的,不懂,我该怎么改呢? ``` wchar_t temp[MAX_PATH]; wsprintf(temp, L"--load-extension=\"%s\"", text.c_str()); WriteLog(L"extList: %s", temp); args.push_back(temp); ``` |
6
shuax 2022-06-16 17:57:27 +08:00
MAX_PATH 改成数字,260 太小了。
|
9
klgd OP |
10
dejavv 2022-10-02 08:41:13 +08:00
楼主看下 shuax 的博客
|