mirror of
https://github.com/bitwarden/browser.git
synced 2024-08-26 23:09:46 +02:00
Ignore regex URI when launching (#28)
* Do not launch regex URI * Fix incorrect check * More null checks
This commit is contained in:
parent
93244b5c90
commit
4aaf452883
|
@ -78,7 +78,7 @@ export class LoginUriView implements View {
|
||||||
if (this._canLaunch != null) {
|
if (this._canLaunch != null) {
|
||||||
return this._canLaunch;
|
return this._canLaunch;
|
||||||
}
|
}
|
||||||
if (this.uri != null) {
|
if (this.uri != null && this.match != UriMatchType.RegularExpression) {
|
||||||
const uri = this.launchUri;
|
const uri = this.launchUri;
|
||||||
for (let i = 0; i < CanLaunchWhitelist.length; i++) {
|
for (let i = 0; i < CanLaunchWhitelist.length; i++) {
|
||||||
if (uri.indexOf(CanLaunchWhitelist[i]) === 0) {
|
if (uri.indexOf(CanLaunchWhitelist[i]) === 0) {
|
||||||
|
|
|
@ -31,11 +31,18 @@ export class LoginView implements View {
|
||||||
}
|
}
|
||||||
|
|
||||||
get canLaunch(): boolean {
|
get canLaunch(): boolean {
|
||||||
return this.hasUris && this.uris[0].canLaunch;
|
return this.hasUris && this.uris.some(uri => uri.canLaunch);
|
||||||
}
|
}
|
||||||
|
|
||||||
get launchUri(): string {
|
get launchUri(): string {
|
||||||
return this.canLaunch ? this.uris[0].launchUri : null;
|
if (this.hasUris) {
|
||||||
|
const uri = this.uris.find(uri => uri.canLaunch)
|
||||||
|
if (uri != null) {
|
||||||
|
return uri.launchUri;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
get hasUris(): boolean {
|
get hasUris(): boolean {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user