noreferrer everywhere

This commit is contained in:
Matt Hill
2021-09-03 14:24:27 -06:00
committed by Aiden McClelland
parent 3877e43b84
commit 9c6aaa64b8
12 changed files with 23 additions and 15 deletions

View File

@@ -154,7 +154,7 @@ export class AppComponent {
} else { } else {
url = 'https://start9.com' url = 'https://start9.com'
} }
window.open(url, '_blank') window.open(url, '_blank', 'noreferrer')
} }
async presentAlertLogout () { async presentAlertLogout () {
@@ -347,7 +347,7 @@ export class AppComponent {
side: 'end', side: 'end',
text: 'View solutions', text: 'View solutions',
handler: () => { handler: () => {
window.open(link, '_blank') window.open(link, '_blank', 'noreferrer')
return false return false
}, },
}, },

View File

@@ -23,6 +23,14 @@ export class MarkdownPage {
async ngOnInit () { async ngOnInit () {
try { try {
this.content = await this.embassyApi.getStatic(this.contentUrl) this.content = await this.embassyApi.getStatic(this.contentUrl)
const links = document.links
for (let i = 0, linksLength = links.length; i < linksLength; i++) {
if (links[i].hostname != window.location.hostname) {
links[i].target = '_blank'
links[i].setAttribute('rel', 'noreferrer')
links[i].className += ' externalLink'
}
}
} catch (e) { } catch (e) {
this.errToast.present(e) this.errToast.present(e)
} finally { } finally {

View File

@@ -79,7 +79,7 @@ export class AppInterfacesItemComponent {
) { } ) { }
launch (url: string): void { launch (url: string): void {
window.open(url, '_blank') window.open(url, '_blank', 'noreferrer')
} }
async copy (address: string): Promise<void> { async copy (address: string): Promise<void> {

View File

@@ -115,7 +115,7 @@ export class AppListPage {
launchUi (pkg: PackageDataEntry, event: Event): void { launchUi (pkg: PackageDataEntry, event: Event): void {
event.preventDefault() event.preventDefault()
event.stopPropagation() event.stopPropagation()
window.open(this.config.launchableURL(pkg), '_blank') window.open(this.config.launchableURL(pkg), '_blank', 'noreferrer')
} }
asIsOrder () { asIsOrder () {

View File

@@ -79,7 +79,7 @@ export class AppShowPage {
} }
launchUi (): void { launchUi (): void {
window.open(this.config.launchableURL(this.pkg), '_blank') window.open(this.config.launchableURL(this.pkg), '_blank', 'noreferrer')
} }
async stop (): Promise<void> { async stop (): Promise<void> {
@@ -124,7 +124,7 @@ export class AppShowPage {
async donate (): Promise<void> { async donate (): Promise<void> {
const url = this.pkg.manifest['donation-url'] const url = this.pkg.manifest['donation-url']
if (url) { if (url) {
window.open(url, '_blank') window.open(url, '_blank', 'noreferrer')
} else { } else {
const alert = await this.alertCtrl.create({ const alert = await this.alertCtrl.create({
header: 'Not Accepting Donations', header: 'Not Accepting Donations',

View File

@@ -23,7 +23,7 @@
<ion-icon slot="icon-only" [name]="unmasked ? 'eye-off-outline' : 'eye-outline'" size="small"></ion-icon> <ion-icon slot="icon-only" [name]="unmasked ? 'eye-off-outline' : 'eye-outline'" size="small"></ion-icon>
</ion-button> </ion-button>
</ion-item> </ion-item>
<p *ngIf="error" style="text-align: left; padding-top: 4px"><ion-text color="danger">{{ error }}</ion-text></p> <p style="text-align: left; padding-top: 4px"><ion-text color="danger">{{ error }}</ion-text></p>
</ion-item-group> </ion-item-group>
<ion-button class="login-button" type="submit" expand="block"> <ion-button class="login-button" type="submit" expand="block">
<span style="font-size: larger; font-weight: bold;">Log In</span> <span style="font-size: larger; font-weight: bold;">Log In</span>

View File

@@ -48,7 +48,7 @@ export class LoginPage {
await this.authService.login(this.password) await this.authService.login(this.password)
this.password = '' this.password = ''
} catch (e) { } catch (e) {
this.error = e.message this.error = e.code === 34 ? 'Invalid Password' : e.message
} finally { } finally {
this.loader.dismiss() this.loader.dismiss()
} }

View File

@@ -165,21 +165,21 @@
</ion-col> </ion-col>
<ion-col sizeSm="12" sizeMd="6"> <ion-col sizeSm="12" sizeMd="6">
<ion-item-group> <ion-item-group>
<ion-item [href]="pkg.manifest['upstream-repo']" target="_blank" detail="false"> <ion-item [href]="pkg.manifest['upstream-repo']" target="_blank" rel="noreferrer" detail="false">
<ion-label> <ion-label>
<h2>Source Repository</h2> <h2>Source Repository</h2>
<p>{{ pkg.manifest['upstream-repo'] }}</p> <p>{{ pkg.manifest['upstream-repo'] }}</p>
</ion-label> </ion-label>
<ion-icon slot="end" name="open-outline"></ion-icon> <ion-icon slot="end" name="open-outline"></ion-icon>
</ion-item> </ion-item>
<ion-item [href]="pkg.manifest['wrapper-repo']" target="_blank" detail="false"> <ion-item [href]="pkg.manifest['wrapper-repo']" target="_blank" rel="noreferrer" detail="false">
<ion-label> <ion-label>
<h2>Wrapper Repository</h2> <h2>Wrapper Repository</h2>
<p>{{ pkg.manifest['wrapper-repo'] }}</p> <p>{{ pkg.manifest['wrapper-repo'] }}</p>
</ion-label> </ion-label>
<ion-icon slot="end" name="open-outline"></ion-icon> <ion-icon slot="end" name="open-outline"></ion-icon>
</ion-item> </ion-item>
<ion-item [href]="pkg.manifest['support-site']" target="_blank" detail="false"> <ion-item [href]="pkg.manifest['support-site']" target="_blank" rel="noreferrer" detail="false">
<ion-label> <ion-label>
<h2>Support Site</h2> <h2>Support Site</h2>
<p>{{ pkg.manifest['support-site'] }}</p> <p>{{ pkg.manifest['support-site'] }}</p>

View File

@@ -15,7 +15,7 @@
<ion-label> <ion-label>
<h2> <h2>
Connecting to your Embassy over LAN is fast and a great fallback in case the Tor network is experiencing issues. Connecting to your Embassy over LAN is fast and a great fallback in case the Tor network is experiencing issues.
<a href="https://docs.start9.com/user-manual/general/lan-setup" target="_blank">View instructions</a> <a href="https://docs.start9.com/user-manual/general/lan-setup" target="_blank" rel="noreferrer">View instructions</a>
</h2> </h2>
<ng-container *ngIf="lanDisabled"> <ng-container *ngIf="lanDisabled">
<br /> <br />

View File

@@ -15,7 +15,7 @@
<ion-label> <ion-label>
<h2> <h2>
Adding SSH keys to your Embassy is useful for command line access, as well as for debugging purposes. Adding SSH keys to your Embassy is useful for command line access, as well as for debugging purposes.
<a [href]="docsUrl" target="_blank">View instructions</a> <a [href]="docsUrl" target="_blank" rel="noreferrer">View instructions</a>
</h2> </h2>
</ion-label> </ion-label>
</ion-item> </ion-item>

View File

@@ -15,7 +15,7 @@
<ion-label> <ion-label>
<h2> <h2>
Adding WiFi credentials to your Embassy allows you to remove the Ethernet cable and move the device anywhere you want. Embassy will automatically connect to available networks. Adding WiFi credentials to your Embassy allows you to remove the Ethernet cable and move the device anywhere you want. Embassy will automatically connect to available networks.
<a href="https://docs.start9.com/user-manual/general/wifi.html" target="_blank">View instructions</a> <a href="https://docs.start9.com/user-manual/general/wifi.html" target="_blank" rel="noreferrer">View instructions</a>
</h2> </h2>
</ion-label> </ion-label>
</ion-item> </ion-item>

View File

@@ -57,7 +57,7 @@ export function getErrorMessage (e: RequestError, link?: string): string | Ionic
} }
if (link) { if (link) {
message = new IonicSafeString(`${message}<br /><br /><a href=${link} target="_blank" style="color: white;">Get Help</a>`) message = new IonicSafeString(`${message}<br /><br /><a href=${link} target="_blank" rel="noreferrer" style="color: white;">Get Help</a>`)
} }
return message return message