新增 Chrome 下载接管扩展与 C++ 本地通信组件
实现链接右键发送、手动地址输入和默认关闭的可选 GET 自动接管,支持站点与文件类型过滤。通过 Native Messaging 和当前用户命名管道在任务入库后确认接管,失败恢复浏览器下载并持久化交接状态。保存请求编号、Referer 与 User-Agent,补充本地注册入口、集成包说明及扩展/stdio/IPC/HTTP 回归测试。
This commit is contained in:
1 parent
6c810c3b4f
commit
028fec64be
41 files changed
+1081
-18
No files matched your search
@@ -65,6 +65,7 @@ int main() {
|
||||
auto path=folder/(L"test_tasks_"+std::to_wstring(GetCurrentProcessId())+L".db");
|
||||
TaskStore store; Check(store.Open(path.wstring()),"open isolated SQLite store");
|
||||
TaskInfo task; task.url=L"https://example.test/中文🚀.bin";
|
||||
task.request_id=L"browser-test-1"; task.referrer=L"https://example.test/页面"; task.user_agent=L"Browser test agent";
|
||||
task.file_name=L"中文🚀.bin"; task.save_path=L"D:\\下载\\中文🚀.bin";
|
||||
Check(store.Insert(task) && task.id>0,"insert task with Unicode");
|
||||
Check(store.UpdateProgress(task.id,123,456),"persist progress");
|
||||
@@ -73,7 +74,8 @@ int main() {
|
||||
auto restored=store.LoadTasks();
|
||||
Check(restored.size()==1 && restored[0].url==task.url && restored[0].save_path==task.save_path
|
||||
&& restored[0].file_name==task.file_name && restored[0].state==TaskState::kPaused
|
||||
&& restored[0].downloaded_bytes==123 && restored[0].error==L"暂停测试","task recovery and UTF-8 persistence");
|
||||
&& restored[0].downloaded_bytes==123 && restored[0].error==L"暂停测试"
|
||||
&& restored[0].request_id==task.request_id && restored[0].referrer==task.referrer && restored[0].user_agent==task.user_agent,"task recovery and UTF-8 persistence");
|
||||
Check(store.DeleteTask(task.id) && store.LoadTasks().empty(),"remove isolated task");
|
||||
store.Close();
|
||||
std::filesystem::remove(path);
|
||||
|
||||
Reference in new issue
Block a user