This commit is contained in:
zh
2025-12-12 10:18:47 +08:00
3 changed files with 20 additions and 2 deletions

View File

@ -436,6 +436,18 @@ function createWindow(): void {
// 1. 创建独立临时会话
const tempSession = createTempSession();
try {
if (option && option.Authorization) {
tempSession.webRequest.onBeforeSendHeaders((details, callback) => {
const headers = Object.assign({}, details.requestHeaders);
headers['Authorization'] = option.Authorization;
callback({ requestHeaders: headers });
});
}
} catch (e) {
console.error('注入认证头失败:', e);
}
// 2. 合并窗口配置:注入独立会话
const windowConfig = {
...params,