음… 제가 좀 더 이 부분에 대해서 살펴보도록 하겠습니다.
chrome.webRequest.onAuthRequired.addListener(
function (details, callbackFn) {
if (details.isProxy == false) {
callbackFn({ cancel: false });
return;
}
if (g_conf.proxy_username.length == 0 ||
g_conf.proxy_password.length == 0) {
callbackFn({ cancel: false });
return;
}
callbackFn({
authCredentials: { username: g_conf.proxy_username, password: g_conf.proxy_password }
});
},
{ urls: ["<all_urls>"] },
['asyncBlocking']
); chrome.webRequest.onAuthRequired.addListener(
function (details, callbackFn) {
if (details.isProxy == false) {
callbackFn({ cancel: false });
return;
}
if (g_conf.proxy_username.length == 0 ||
g_conf.proxy_password.length == 0) {
callbackFn({ cancel: false });
return;
}
callbackFn({
authCredentials: { username: g_conf.proxy_username, password: g_conf.proxy_password }
});
},
{ urls: ["<all_urls>"] },
['asyncBlocking']
);
미꾸라지 확장 코드에는 위와 같이 chrome.webRequest.onAuthRequired listener 을 등록하는 과정이 있는데, 이 부분이 @coey0814 님께서 말씀하신 로그인 과정과 매우 밀접한 관련이 있는 부분입니다.
문제는 Chrome Extensions에서 동일한 이벤트(예: chrome.webRequest.onAuthRequired
)를 여러 개의 확장 프로그램이 등록한 경우, 확장 프로그램 간의 호출 순서는 공식적으로 보장되지 않는 것이 이슈가 아닐까 합니다. ㅠ.ㅠ 그래서 만약 다른 확장 프로그램이 이에 대한 처리를 해버리면 미꾸라지가 처리할 기회가 없어질수도 있습니다.