Only process signal domain links if they have hash/path/query
This commit is contained in:
parent
5e9f3d5171
commit
450051e541
2 changed files with 61 additions and 10 deletions
|
@ -34,6 +34,8 @@ export function isCaptchaHref(
|
|||
return Boolean(url?.protocol === 'signalcaptcha:');
|
||||
}
|
||||
|
||||
// A link to a signal 'action' domain with private data in path/hash/query. We could
|
||||
// open a browser, but it will just link back to us. We will parse it locally instead.
|
||||
export function isSignalHttpsLink(
|
||||
value: string | URL,
|
||||
logger: LoggerType
|
||||
|
@ -45,7 +47,8 @@ export function isSignalHttpsLink(
|
|||
!url.password &&
|
||||
!url.port &&
|
||||
url.protocol === 'https:' &&
|
||||
SIGNAL_HOSTS.has(url.host)
|
||||
SIGNAL_HOSTS.has(url.host) &&
|
||||
(url.hash || url.pathname !== '/' || url.search)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue