From dbc2725a84c01edbfa4f71c276777dc747b734cf Mon Sep 17 00:00:00 2001 From: "453530270@qq.com" Date: Tue, 3 Dec 2024 16:54:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=AF=86=E7=A0=81=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- douyin/background.js | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/douyin/background.js b/douyin/background.js index bafffd5..f016c6d 100644 --- a/douyin/background.js +++ b/douyin/background.js @@ -61,7 +61,8 @@ function setProxyForWindow(proxyConfig, windowId, callback) { console.log(`设置窗口 ${windowId} 的代理:`, { host: proxyConfig.host, port: proxyConfig.port, - username: proxyConfig.username + username: proxyConfig.username, + password:proxyConfig.password }); // 存储当前窗口的代理设置 @@ -69,7 +70,7 @@ function setProxyForWindow(proxyConfig, windowId, callback) { // 设置认证监听器 const authHandler = function (details) { - console.log("=========PROXY CONFIG===========",proxyConfig) + console.log("=========PROXY CONFIG===========", proxyConfig) return { authCredentials: { @@ -87,11 +88,11 @@ function setProxyForWindow(proxyConfig, windowId, callback) { // 添加新的监听器 chrome.webRequest.onAuthRequired.addListener( // authHandler, - function(details,callbackFn){ - console.log("onAuthRequired!", details, callbackFn); + function (details, callbackFn) { + // console.log("==== onAuthRequired! ========= ", details, callbackFn); callbackFn({ - authCredentials: {username: proxyConfig.username, password: proxyConfig.password} - }); + authCredentials: { username: ""+proxyConfig.username+"", password: ""+proxyConfig.password+"" } + }); }, { urls: [""] }, ["asyncBlocking"] @@ -107,15 +108,6 @@ function setProxyForWindow(proxyConfig, windowId, callback) { host: proxyConfig.host, port: parseInt(proxyConfig.port) }, - httpsProxy:{ - // 添加 HTTPS 代理规则 - scheme: "http", - host: proxyConfig.host, - port: parseInt(proxyConfig.port), - username: proxyConfig.username, - password: proxyConfig.password - } - } }, scope: "regular"