javascript - Chrome Extension with proxy, onAuthRequired never being triggered - Stack Overflow
I try to make a proxy in the Chrome extension, proxy is working connecting and all is good. But I need to manually enter auth credentials for proxy connection.
I'm trying to use webRequest
and webRequestAuthProvider
to automatically apply proxy auth credentials when it is required
let authListener = function(details, callbackFn) {
console.log('Auth required for', details.url);
callbackFn({
authCredentials: {
username: 'username',
password: 'pass',
}
});
}
chrome.webRequest.onAuthRequired.addListener(
authListener,
{ urls: ["<all_urls>"] }
['asyncBlocking']
);
When proxy auth block popups in the browser, chrome.webRequest.onAuthRequired
never being triggered, but, for example, chrome.webRequest.onBeforeRequest
or chrome.webRequest.onCompleted
are triggered correctly
"permissions": ["storage", "alarms", "tabs", "proxy", "webRequest", "webRequestAuthProvider"],
export function proxyConnect(proxy, scheme = 'http') {
chrome.proxy.settings.set(
{
value: {
mode: "fixed_servers",
rules: {
singleProxy: {
scheme,
host: proxy.host,
port: proxy.port
},
bypassList: [''] // "<all_urls>"
}
},
scope: 'regular'
},
);
}
最新文章
- 10月份微软Surface平板线上份额猛增 首次超iPad
- 2012年NEC云时代平台软件全国巡展启动
- 英特尔公布搭载其芯片的Windows 8平板电脑的硬件配置规范
- azure cosmosdb - Cosmos DB REST API using Resource Token gives 403 Forbidden - Stack Overflow
- laravel - Filament | Processing Attachment using API through Email via SendGrid - Stack Overflow
- Formulas in Looker Studio with Hubspot data not working - Stack Overflow
- reactjs - Why can't AWS Amplify find my components from a working version of my React App? - Stack Overflow
- python - ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', Remo
- Prisma create: Typescript error in field data - Stack Overflow
- javascript - TypeError with firebase authentication - Stack Overflow
- node.js - Cors errors S3 Upload node - Stack Overflow
- html - Disable scrolling. Overflow:hidden not working - Stack Overflow
- python - How to display only the tags translated into the corresponding language on a multilingual site? - Stack Overflow
- VS Code extension for collapsing sub-folders - Stack Overflow
- scala - How does maxOffsetsPerTrigger works in spark structured streaming - Stack Overflow
- flutter - Exported Excel File is Blank When Using excel Package - Stack Overflow
- php - 406 error when sendingreceiving JSON data - Stack Overflow