mirror of
https://github.com/tridactyl/tridactyl.git
synced 2026-09-10 07:16:33 -04:00
Fix #5015: add magic none proxy as override for autocontain
Some checks failed
e2e / test (firefox, ubuntu) (push) Has been cancelled
e2e / test (firefox, windows) (push) Has been cancelled
e2e / test (firefoxesr, ubuntu) (push) Has been cancelled
lint / lint (lint) (push) Has been cancelled
lint / lint (mozilla) (push) Has been cancelled
lint / lint (unit) (push) Has been cancelled
Website / build (push) Has been cancelled
Website / deploy (push) Has been cancelled
Some checks failed
e2e / test (firefox, ubuntu) (push) Has been cancelled
e2e / test (firefox, windows) (push) Has been cancelled
e2e / test (firefoxesr, ubuntu) (push) Has been cancelled
lint / lint (lint) (push) Has been cancelled
lint / lint (mozilla) (push) Has been cancelled
lint / lint (unit) (push) Has been cancelled
Website / build (push) Has been cancelled
Website / deploy (push) Has been cancelled
This commit is contained in:
parent
507ea9d8be
commit
de5a1a414f
|
|
@ -4701,7 +4701,7 @@ export function autocmd(event: string, url: string, ...excmd: string[]) {
|
|||
* Pass an optional space-separated list of proxy names to assign a proxy (followed by failover proxies) to a URL and open in a specified container.
|
||||
* For example: `autocontain [-{u,s}] pattern container proxy1 proxy2`
|
||||
*
|
||||
* To assign a proxy and open in no container, use "firefox-default" or "none" as a container name.
|
||||
* To assign a proxy and open in no container, use "firefox-default" or "none" as a container name. To override [[proxy]] and use no proxy, use the special proxy 'none' e.g. `autocontain -s whatismyipaddress\.com none none`
|
||||
* See also:
|
||||
* - [[proxyadd]]
|
||||
* - [[proxyremove]]
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ export const proxyFromUrl = (proxyUrl: string): ProxyInfo => {
|
|||
|
||||
export function exists(names: string[]) {
|
||||
const currProxies = Object.keys(config.get("proxies"))
|
||||
const missingProxies = names.filter(name => !currProxies.includes(name))
|
||||
const missingProxies = names.filter(name => !currProxies.includes(name) && name !== "none")
|
||||
if (missingProxies.length) {
|
||||
throw new Error(
|
||||
`${
|
||||
|
|
@ -121,6 +121,9 @@ const getProxies = (): { [key: string]: ProxyInfo } => {
|
|||
const getProxiesForUrl = async (url: string): Promise<ProxyInfo[]> => {
|
||||
const aucon = new AutoContain()
|
||||
const [, containerProxies] = await aucon.getAuconAndProxiesForUrl(url)
|
||||
if (containerProxies[0] === "none") {
|
||||
return []
|
||||
}
|
||||
const proxies = getProxies()
|
||||
const filteredProxies = Object.entries(proxies)
|
||||
.filter(([name, ]) => containerProxies.includes(name))
|
||||
|
|
|
|||
Loading…
Reference in a new issue