Fix urlbar.

This commit is contained in:
schmelczerandras 2019-07-10 09:21:23 +02:00
parent 9d2efb3c45
commit 187381638e

View File

@ -148,12 +148,21 @@ export class DashboardComponent implements OnInit, OnDestroy {
iframeLoad(): void {
if (this.webiframe) {
this.actualIframeUrl = this.webiframe.nativeElement.contentWindow.frames.location.pathname;
const href = this.webiframe.nativeElement.contentWindow.frames.location.href;
const niceURL = href.match(/.*?\/\/.*?(\/.*)/)[1];
this.actualIframeUrl = niceURL;
}
}
changeIframeURL() {
this.webiframe.nativeElement.contentWindow.frames.location.pathname = this.urlbar.nativeElement.value;
const userGivenValue = this.urlbar.nativeElement.value.trim();
if(
userGivenValue == '/' ||
userGivenValue.startsWith('dashboard') ||
userGivenValue.startsWith('/dashboard')
)
return;
this.webiframe.nativeElement.contentWindow.frames.location.href = this.urlbar.nativeElement.value;
}
pollingServerForIframeReload() {